Exemplo n.º 1
0
 public static function loadAll()
 {
     static $loaded;
     if (isset($loaded)) {
         return true;
     }
     $loaded = 1;
     $roots = MRoots::getInstance();
     $rootIds = $roots->getKeys();
     foreach ($rootIds as $id) {
         self::getInstance($id);
     }
     return true;
 }
Exemplo n.º 2
0
        if (file_exists($_path)) {
            require_once $_path;
        }
    }
}
// include the general peer
includePeer("general");
require_once 'includes' . DS . 'functions.php';
require_once 'classes' . DS . 'file.php';
require_once 'classes' . DS . 'mdo.php';
require_once 'classes' . DS . 'config.php';
// Init config
$cfg = MConfig::instance();
require_once 'classes' . DS . 'rights.php';
require_once 'classes' . DS . 'roots.php';
$roots = MRoots::getInstance();
if ($roots->getCount() == 0) {
    require_once 'includes' . DS . 'nofolders.php';
}
MRights::loadAll();
// Defining the demo mode
define('_FM_IS_DEMO', (bool) $cfg->get("is_demo", false) && !MRights::userIsRoot() ? true : false);
require_once 'classes' . DS . 'object.php';
require_once 'classes' . DS . 'container.php';
require_once 'classes' . DS . 'view.php';
require_once 'classes' . DS . 'task.php';
require_once 'includes' . DS . 'version.php';
require_once 'includes' . DS . 'saved.php';
require_once 'includes' . DS . 'helpers.php';
require_once 'includes' . DS . 'icons.php';
require_once 'includes' . DS . 'filesystem.php';
Exemplo n.º 3
0
 function rights()
 {
     $id = MRequest::int("id", null);
     $isSend = MRequest::int("send", 0);
     if ($isSend) {
         return $this->_rightsSave($id);
     }
     $this->view->slot("beforemenu", MRightsHelper::rootsMenuHeading());
     $roots = MRoots::getInstance();
     $this->view->slot("rootscount", $roots->getCount());
     $getFirst = 0;
     if ($id === null || !is_int($id) || $id < 0) {
         $getFirst = 1;
     } else {
         $rootFolder = $roots->get($id);
         if ($rootFolder === false) {
             $getFirst = 1;
         }
     }
     if ($getFirst) {
         $arr = $roots->getFirst();
         $id = $arr[0];
         $rootFolder = $arr[1];
     }
     $this->view->slot("rootfolderid", $id);
     $this->view->add2Menu(MRightsHelper::rootsMenu($roots->get(), $id, "rights"));
     $rights = MRights::getInstance($id);
     $content = MRightsHelper::form(MRightsHelper::rights($rights->getTree(), $id), "rights", array("id" => $id), MRequest::int("grouptab", null));
     // 		$this->view->addPreToContent($rights->getTree());
     $this->view->add2Content(MRightsHelper::rightsWrap($rootFolder->get("name"), $content));
 }