/usr/share/knowledgeroot/include/class-extension-base.php is in knowledgeroot 0.9.9.5-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | <?php
/**
* This Class is a base class for extensions
*
* @package Knowledgeroot
* @author Frank Habermann
* @version $Id: class-extension-base.php 493 2007-07-14 20:37:35Z lordlamer $
*/
class extension_base {
// global class array
var $CLASS = array();
// var for options from extension/config.php
var $CONF = array();
// show addfiles for this extension
// default is disabled
var $show_addedfiles = 0;
// array for the menu items
var $menu = array();
// array with langtokens for this extension
var $getLang = array();
// array with post data for this extension - index.php?extname[varname]=test - so varname will be available in this GET
var $GET = array();
// array with post data for this extension - index.php?extname[varname]=test - so varname will be available in this POST
var $POST = array();
// Path to the extension (relativ)
var $myPath = "";
// Path in system for extension (absolute)
var $myAbsolutePath = "";
/**
* init/start class
*/
function __contruct(&$CLASS) {
$this->CLASS =& $CLASS;
// load GET and POST
if(isset($_GET[get_class($this)])) $this->GET = $_GET[get_class($this)];
if(isset($_POST[get_class($this)])) $this->GET = $_POST[get_class($this)];
return 0;
}
/**
*
*/
function extension_base(&$CLASS) {
$this->CLASS =& $CLASS;
// load GET and POST
if(isset($_GET[get_class($this)])) $this->GET = $_GET[get_class($this)];
if(isset($_POST[get_class($this)])) $this->GET = $_POST[get_class($this)];
return 0;
}
/**
* default functon for start
*/
function main() {
return "";
}
/**
* Alias function for T_(modul,langtoken)
*/
function T_($langtoken) {
return T_dgettext(get_class($this), $langtoken);
}
/**
* default function do display content
*/
function show_content($id = "") {
return "";
}
/**
* display textbox and load rte if possible
*/
function getTextbox($value = "", $use_rte = TRUE) {
$out = "";
if ($use_rte == TRUE) {
$out .= $this->CLASS['rte']->show($value);
} else {
$out .= "<textarea name=\"content\" cols=\"50\" rows=\"8\">\n";
$out .= $value;
$out .= "</textarea>\n";
}
return $out;
}
/**
* display rightpanel if possible
*/
function getRightpanel($user=0,$group=0,$userrights=0,$grouprights=0,$otherrights=0) {
$panel = "";
if(!empty($_SESSION['userid'])) {
$panel = $this->CLASS['knowledgeroot']->editRightPanel($user,$group,$userrights,$grouprights,$otherrights);
}
return $panel;
}
/**
* get rightpanel by contentid
*/
function getRightpanelByID($contentid) {
$panel = "";
if(!empty($_SESSION['userid'])) {
$res = $this->CLASS['db']->query(sprintf("SELECT * FROM content WHERE id=%d AND deleted=0",$contentid));
$anz = $this->CLASS['db']->num_rows($res);
if($anz == 1) {
$row = $this->CLASS['db']->fetch_assoc($res);
$panel = $this->CLASS['knowledgeroot']->editRightPanel($row['owner'],$row['group'],$row['userrights'],$row['grouprights'],$row['otherrights']);
}
}
return $panel;
}
/**
* display users default right panel
* used for creation of new content
*/
function getDefaultRightpanel() {
return $this->CLASS['knowledgeroot']->rightpanel($_SESSION['userid']);
}
}
?>
|