Пример #1
0
 public function __construct($node, $parent = null, $edit_type = 0)
 {
     global $a;
     global $user;
     global $thulit;
     $this->parent = $parent;
     if (isset($parent)) {
         $this->properties = $parent->properties;
     }
     load_node_properties($node, $this);
     $this->_prepare();
     load_properties($node, $this);
     //$this->display_tpl();
     $vl = $this->properties['view_level'];
     if (!isset($vl)) {
         $vl = 99;
     }
     if ($user['user_level'] > $vl) {
         loginFunction(2);
     } else {
         $this->_prepare();
         $this->_check();
         print_tpl($this);
     }
 }
Пример #2
0
 public function __construct($node, $parent = null, $edit_type = 0)
 {
     global $a;
     global $user;
     $this->parent = $parent;
     if (isset($parent)) {
         $this->properties = $parent->properties;
     }
     load_properties($node, $this);
     $this->_prepare();
     //$this->display_tpl();
     if ($edit_type == 0) {
         //display node
         $vl = $this->properties['view_level'];
         if (!isset($vl)) {
             $vl = 99;
         }
         if ($user['user_level'] > $vl) {
             loginFunction(2);
         } else {
             print_tpl($this);
         }
     } elseif ($edit_type > 0) {
         //editing node
         $el = $this->properties['edit_level'];
         if (!isset($el)) {
             $el = 99;
         }
         if ($user['user_level'] <= $el) {
             $this->edit_text();
         } else {
             loginFunction(2);
         }
     } elseif ($edit_type < 0) {
         //saving changes
         $el = $this->properties['edit_level'];
         if (!isset($el)) {
             $el = 99;
         }
         if ($user['user_level'] <= $el) {
             $this->save_text();
         } else {
             loginFunction(2);
         }
     }
 }
Пример #3
0
	function load($pathname) {
		if (strrpos($pathname, '.dtd') == strlen($pathname) - 4) {
			return load_dtd($pathname);
		} else {
			return load_properties($pathname);
		}
	}