Exemplo n.º 1
0
    /**
     *
     * Loads Data for Navigation in Region West
     * @param sfWebRequest $request
     * @return <type>
     */
    public function executeLoadMenue(sfWebRequest $request) {
        $menueObject = new Menue();
        $result = CredentialTable::instance()->getAllCredentials('c.usermodule asc,c.usergroup asc');

        $menueObject->setRecords($result);
        $menueObject->setUserright($this->getUser()->getAttribute('credential'));
        $menueObject->setContext($this->getContext());

        $json_result = $menueObject->buildTree();
        $this->renderText('{"result":'.json_encode($json_result).'}');
     
        return sfView::NONE;
    }
 public function getAll()
 {
     if (!isset($this->Elements) || $this->countElements() < 0) {
         return Menue::getEmptyInstance();
     }
     return $this->Elements;
 }
Exemplo n.º 3
0
 public function showHomescreen()
 {
     if (!Controler_Main::getInstance()->isUserLoggedIn()) {
         $ControlerStart = new Controler_Start();
         $ControlerStart->start();
         return false;
     }
     $Request = new Request();
     $this->Menue = Menue::getEmptyInstance();
     $Request = new Request();
     // var_dump($_COOKIE);
     $MenueFinder = new MenueFinder();
     $this->Menue = $MenueFinder->findByID(1);
     $this->User = Controler_Main::getInstance()->getUser();
     $Template = Template::getInstance("tpl_Home.php");
     $MenueFinder = new MenueFinder();
     $MenueCollection = $MenueFinder->findAll();
     $Template->assign("User", $this->User);
     $Template->assign("UserName", Controler_Main::getInstance()->getUser()->getName());
     $Template->assign("UserID", Controler_Main::getInstance()->getUser()->getId());
     $Template->assign("MenueCollection", $MenueCollection);
     $Template->assign("Menue", $this->Menue);
     $Template->render();
 }
Exemplo n.º 4
0
 public function insert(Menue $Menue)
 {
     $Sql = "INSERT INTO `tbl_menues` (`s_Name`, `i_Position`) \n\t\tVALUES \n\t\t(\n\t\t'" . $Menue->getName() . "',\n\t\t '0'\n\t\t)";
     //var_dump($Sql);
     return $this->MySql->executeNoneQuery($Sql);
 }
 /**
  * 
  * showEditMenue
  * 
  * @param String $ErrorString
  * @param String $StatusString
  */
 public function showEditMenue($ErrorString = "", $StatusString = "")
 {
     if (Controler_Main::getInstance()->getUserLevel() < BACKEND_USERLEVEL) {
         $ControlerStart = new Controler_Start();
         $ControlerStart->start();
         return false;
     }
     $Request = new Request();
     $ID = $Request->getAsInt("MenueID");
     $Menue = Menue::getEmptyInstance();
     $MenueFinder = new MenueFinder();
     $Menue = $MenueFinder->findById($ID);
     $MenueCollection = $MenueFinder->findAll();
     $ContentGroupFinder = new ContentGroupFinder();
     $ContentGroupCollection = $ContentGroupFinder->findAll();
     $ContentFinder = new ContentFinder();
     $ContentCollection = $ContentFinder->findAll();
     $CommandFinder = new CommandFinder();
     $CommandCollection = $CommandFinder->findAll();
     $ViewFinder = new ViewFinder();
     $ViewCollection = $ViewFinder->findAll();
     $Template = Template::getInstance("tpl_BE_MenueEdit.php");
     $Template->assign("Menue", $Menue);
     $Template->assign("MenueCollection", $MenueCollection);
     $Template->assign("ContentGroupCollection", $ContentGroupCollection);
     $Template->assign("ContentCollection", $ContentCollection);
     $Template->assign("CommandCollection", $CommandCollection);
     $Template->assign("ViewCollection", $ViewCollection);
     $Template->assign("MenueId", $ID);
     $Template->assign("ErrorString", $ErrorString);
     $Template->assign("StatusString", $StatusString);
     if (isset($StatusString)) {
         $Template->render(true, true);
     } else {
         $Template->render();
     }
 }