Exemple #1
0
 function cls_menu($xml_url, $type)
 {
     global $elm, $engine_path, $site, $site_path;
     $this->level = $level;
     $xml_document = xml_contents($site_path . "xml/" . $site . $xml_url . ".xml");
     if (!$xml_document) {
         print "{$site_path}" . "xml/" . $site . $type . ".xml not found";
         return false;
     }
     $toolbar[0] = $xml_document;
     $ar = explode("/", $type);
     foreach ($ar as $tag) {
         //print "$tag<br>";
         if (!($toolbar = $toolbar[0]->getElementsByTagName($tag))) {
             return false;
         }
         //print "error reading XML: $tag<br>";
     }
     $this->xml_document = $toolbar[0];
     foreach (get_class_vars(get_class($this)) as $name => $val) {
         if (strlen($v = $toolbar[0]->getAttribute($name, ''))) {
             $this->{$name} = $v;
         }
     }
 }
Exemple #2
0
 function root($tag)
 {
     $item = xml_contents("xml/common/root.xml");
     $table = $item->getElementsByTagName($tag);
     $this->xml_document = $table[0];
     foreach (get_class_vars(get_class($this)) as $val => $name) {
         if (strlen($v = $table[0]->getAttribute($name))) {
             $this->{$name} = $v;
         }
     }
 }
 function cls_form($type, $tag)
 {
     global $site_path, $engine_path, $site, $idt, $step;
     $this->type = $type;
     $this->name = $tag;
     if (!$type) {
         return false;
     }
     $this->template = xml_contents($engine_path . "xml/templates/main.xml");
     $item = xml_contents($site_path . "xml/" . $site . $type . ".xml");
     if (!$item) {
         print "{$site_path}" . "xml/" . $site . $type . ".xml not found";
         return false;
     }
     $this->table = $item->getAttribute('table', '');
     $this->act = $item->getAttribute('act', '');
     $this->image = $item->getAttribute('image', '');
     $this->php = $item->getAttribute('php', '');
     $this->title = set_params($item->getAttribute('title', ''));
     $this->privacy = set_params($item->getAttribute('privacy', ''));
     $this->showlogo = set_params($item->getAttribute('showlogo', ''));
     $this->formwidth = set_params($item->getAttribute('formwidth', ''));
     $this->short = set_params($item->getAttribute('short', ''));
     $this->redirect = set_params($item->getAttribute('redirect', ''));
     $this->hint = set_params($item->getAttribute('hint', ''));
     $this->success = set_params($item->getAttribute('success', ''));
     $this->vip = set_params($item->getAttribute('vip', ''));
     if (!$tag) {
         $this->name = set_params($item->getAttribute('name', ''));
     }
     if (!$this->name) {
         $this->name = "select";
     }
     $this->empty = set_params($item->getAttribute('empty', ''));
     //if(!$this->empty) $this->empty="Records not found";
     $this->banner = $item->getAttribute('banner', '');
     $table = $item->getElementsByTagName($this->name);
     $this->document = $table[0];
     if (!$table[0]) {
         return false;
     }
     foreach (get_class_vars(get_class($this)) as $name => $val) {
         if (strlen($v = $table[0]->getAttribute($name, ''))) {
             $this->{$name} = $v;
         }
         //print $name."=$v<br>";
     }
     if (substr($this->sql, 0, 6) == "select" && $this->name != "search" && $this->act != "search") {
         $this->act = "select";
     } elseif (!$this->act) {
         $this->act = $this->name;
     }
     $this->hint = nl2br($this->hint);
     if ($this->act == "select") {
         $this->getRows();
     }
     if ($site == "moderate/") {
         $this->privacy = 2;
     }
     if ($site == "admin/") {
         $this->privacy = 2;
     }
     if (strstr($site, "admin")) {
         $this->privacy = 2;
     }
 }
Exemple #4
0
 function getTemplates()
 {
     global $site_path;
     $xml = select("select PageID,Xml,Date from en_pages where Type='templates'");
     if (!$xml[0] || $xml[Date] < filemtime($site_path . "xml/templates/main.xml")) {
         $item = xml_contents($site_path . "xml/templates/main.xml");
         $item->Xml2File('templates', '');
         $xml = select("select PageID,Xml from en_pages where Type='templates'");
     }
     if ($xml[0]) {
         $str = $xml[1];
         //print $str;
         //exit;
         $ar = explode("#?;", $str);
         $j = 0;
         foreach ($ar as $v2) {
             $ar2 = explode("|?;", $v2);
             $t = $ar2[0];
             for ($i = 1; $i < count($ar2); $i++) {
                 if ($i % 2 == 0) {
                     if ($t == "field" || $t == "item" || $t == "button") {
                         $this->templateattributes[$t][$j][$k] = $ar2[$i];
                     } else {
                         $this->templateattributes[$t][$k] = $ar2[$i];
                     }
                 } else {
                     $k = $ar2[$i];
                 }
             }
             $j++;
         }
     }
 }
Exemple #5
0
<?php

require '../config.php';
unset($act);
$type = "gladiators/builder";
$act = "select";
require $engine_path . "cls/auth/session.php";
$glad2 = get_gladiators($auth->user);
$glad2 = $serialized;
require $site_path . "up.php";
$fields = array();
if (!$id) {
    $q = select("select * from ft_agreements where (UserID1='{$auth->user}' or UserID2='{$auth->user}') and Approved=1");
    $id = $q[RecordID];
}
$ob = xml_contents($engine_path . "/xml/gladiators/builder.xml");
$ar = $ob->childNodes();
$localization = "";
foreach ($ar as $a) {
    $forma = new cls_form("gladiators/builder", $a->tagname);
    $arr = array();
    foreach ($forma->getfields() as $field) {
        $control = new cls_controls($field, $this);
        if ($control) {
            $arr[$control->name] = $control;
        }
    }
    $fields[$a->tagname] = $arr;
}
function DrawControl($game, $type, $formaat)
{