Source for file admin.languages.class.php
Documentation is available at admin.languages.class.php
* @copyright Refer to copyright.php
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Mambo Foundation Inc see README.php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$this->attributes =
array();
function set($var, $value)
$this->vars[$var] =
$value;
$this->vars[$var] =
&$value;
return $this->vars[$var];
$name =
'__' .
$this->name .
'_session';
if (!isset
($_SESSION[$name]) ||
$reset) {
$_SESSION[$name] =
array();
if (!isset
($requests[$name])) {
$requests[$name] =
new Request($name);
$this->renderer->setdir(dirname(__FILE__
).
DIRECTORY_SEPARATOR.
'views'.
DIRECTORY_SEPARATOR.
'templates');
if (!$actionname) return $this->view('index');
$actionfile =
dirname(__FILE__
).
"/actions/$actionname.action.php";
$actionclass =
$actionname.
'Action';
else return trigger_error("Action file '$actionfile' not found.", E_USER_ERROR);
if (class_exists($actionclass)) $action =
new $actionclass();
else return trigger_error("Action class '$actionclass' not found.", E_USER_ERROR);
$action->execute($this, $this->request);
$viewfile =
dirname(__FILE__
).
"/views/$viewname.view.php";
$viewclass =
$viewname.
'View';
#else return trigger_error("View file '$viewfile' not found.", E_USER_ERROR);
if (class_exists($viewclass)) $view =
new $viewclass($this);
else return trigger_error("View class '$viewclass' not found.", E_USER_ERROR);
function redirect($task=
null, $act=
null)
$url =
$_SERVER['PHP_SELF'].
'?option='.
$this->name;
$url .=
!is_null($task) ?
'&task='.
$task :
'';
$url .=
!is_null($act) ?
'&act='.
$act :
'';
echo
"<script>document.location.href='$url';</script>";
#if (ob_get_contents()) while (@ob_end_clean()); // clear output buffer if one exists
function execute(&$controller, &$request)
return trigger_error('Action::execute() must be overridden.', E_USER_ERROR);
function View(&$controller){
function render(&$request, &$renderer)
$classname =
$type .
'Renderer';
$renderer[$type] =
new $classname();
function display($template, $return =
false){
return trigger_error('A template has not been specified', E_USER_ERROR);
return trigger_error("Template file $template does not exist or is not readable", E_USER_ERROR);
function fetch($template){
return $this->display($template, true);
function addvar($key, $value){
$this->vars[$key] =
$value;
$this->vars[$key] =
$value;
return (isset
($this->vars[$name])) ?
$this->vars[$name] :
$this->vars;
$this->dir =
(substr($dir, -
1) ==
DIRECTORY_SEPARATOR) ?
$dir :
$dir.
DIRECTORY_SEPARATOR;
$current =
$prev =
array();
foreach($values as $key =>
$value) {
$index =
count($xmlarray);
$xmlarray[$index] =
array();
$xmlarray[$index]['tag'] = isset
($value["tag"]) ?
$value["tag"] :
null;
$xmlarray[$index]['value'] = isset
($value["value"]) ?
$value["value"] :
null;
$xmlarray[$index]['attributes'] = isset
($value["attributes"]) ?
$value["attributes"] :
null;
$xmlarray[$index]['nodes'] =
array();
$prev[count($prev)] =
&$xmlarray;
$xmlarray =
&$xmlarray[$index]['nodes'];
$xmlarray[$index] =
array();
$xmlarray[$index]['tag'] = isset
($value["tag"]) ?
$value["tag"] :
null;
$xmlarray[$index]['value'] = isset
($value["value"]) ?
$value["value"] :
null;
$xmlarray[$index]['attributes'] = isset
($value["attributes"]) ?
$value["attributes"] :
null;
$xmlarray =
&$prev[count($prev) -
1];
unset
($prev[count($prev) -
1]);
$xml =
"<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
if ((!empty($array)) AND (is_array($array))) {
foreach ($array as $key =>
$value) {
switch ($value["type"]) {
if (isset
($value["attributes"])) {
foreach ($value["attributes"] as $k =>
$v) {
if (isset
($value["attributes"])) {
foreach ($value["attributes"] as $k =>
$v) {
$xml .= isset
($value['value']) ?
$value['value'] :
false;
Documentation generated on Mon, 05 May 2008 16:15:21 +0400 by phpDocumentor 1.4.0