| 138 |
var $option = ''; |
var $option = ''; |
| 139 |
|
|
| 140 |
function mosComponentUserManager ($component, $control_name, $alternatives, $default, $title) { |
function mosComponentUserManager ($component, $control_name, $alternatives, $default, $title) { |
| 141 |
$this->plugin_name = $component; |
$this->plugin_name = strtolower(str_replace(' ', '', $component)); |
| 142 |
$this->option = mamboCore::get('option'); |
$this->option = mamboCore::get('option'); |
| 143 |
$this->noMagicQuotes(); |
$this->noMagicQuotes(); |
| 144 |
$mainframe =& mosMainFrame::getInstance(); |
$mainframe =& mosMainFrame::getInstance(); |
| 146 |
$func = mosGetParam ($_REQUEST, $control_name, $default); |
$func = mosGetParam ($_REQUEST, $control_name, $default); |
| 147 |
if (isset($alternatives[$func])) $method = $alternatives[$func]; |
if (isset($alternatives[$func])) $method = $alternatives[$func]; |
| 148 |
else $method = $func; |
else $method = $func; |
| 149 |
$classname = $component.'_'.$method.'_Controller'; |
$classname = $this->plugin_name.'_'.$method.'_Controller'; |
| 150 |
if (class_exists($classname)) { |
if (class_exists($classname)) { |
| 151 |
$controller =& new $classname($this); |
$controller =& new $classname($this); |
| 152 |
if (is_callable(array(&$controller,$method))) $controller->$method($func); |
if (is_callable(array(&$controller,$method))) $controller->$method($func); |
| 153 |
else trigger_error (sprintf(T_('Component %s error: attempt to use non-existent method %s in %s'), $component, $method, $controller)); |
else trigger_error (sprintf(T_('Component %s error: attempt to use non-existent method %s in %s'), $this->plugin_name, $method, $controller)); |
| 154 |
} |
} |
| 155 |
else trigger_error("Component $component error: attempt to use non-existent class $classname"); |
else trigger_error(sprintf(T_('Component %s error: attempt to use non-existent class %s'), $this->plugin_name, $classname)); |
| 156 |
$this->restore_magic_quotes(); |
$this->restore_magic_quotes(); |
| 157 |
} |
} |
| 158 |
|
|
| 159 |
function newHTMLClassCheck ($name, &$controller, $total_items, $clist) { |
function newHTMLClassCheck ($name, &$controller, $total_items, $clist) { |
| 160 |
if (class_exists($name)) return new $name ($controller, $this->limit, $clist); |
if (class_exists($name)) return new $name ($controller, $this->limit, $clist); |
| 161 |
trigger_error("Component $this->plugin_name error: attempt to use non-existent class ".$name); |
trigger_error(sprintf(T_('Component %s error: attempt to use non-existent class %s'), $this->plugin_name, $name)); |
| 162 |
return false; |
return false; |
| 163 |
} |
} |
| 164 |
|
|
| 177 |
var $currid = 0; |
var $currid = 0; |
| 178 |
|
|
| 179 |
function mosComponentAdminManager ($plugin_name) { |
function mosComponentAdminManager ($plugin_name) { |
| 180 |
$this->plugin_name = $plugin_name; |
$this->plugin_name = strtolower(str_replace(' ', '', $plugin_name)); |
| 181 |
$this->noMagicQuotes(); |
$this->noMagicQuotes(); |
| 182 |
if ($this->act = mosGetParam ($_REQUEST, 'act', strtolower(str_replace(' ', '_', $plugin_name)))); |
if ($this->act = mosGetParam ($_REQUEST, 'act', $this->plugin_name)); |
| 183 |
if ($this->task = mosGetParam($_REQUEST, 'task', 'list')); |
if ($this->task = mosGetParam($_REQUEST, 'task', 'list')); |
| 184 |
else $this->task = 'list'; |
else $this->task = 'list'; |
| 185 |
$mainframe = mosMainFrame::getInstance(); |
$mainframe = mosMainFrame::getInstance(); |