/** * Constructs the IcfTemplating object */ function IcfTemplating($page = "") { // Load configuration $icfConfig = new IcfConfig(); $this->tpl =& new Savant2(); // add a template path $this->tpl->addPath("template", $icfConfig->cfg_site_beTemplatePath); $this->tpl->assign("templatePath", $icfConfig->cfg_site_beTemplateUrl); $this->tpl->assign("basePath", $icfConfig->cfg_site_feBaseUrl); // multilingual support require_once $this->getStringsFile($icfConfig); // Session support $session = new Session(); $this->tpl->assign("user", $session->getSessionUser()); // basic toolbar support $toolbarItem = new icfToolbarItem(); $toolbarItem->setName("exit"); $toolbarItem->setTitle($text["exit"]); $toolbarItem->setUrl("login.php"); $toolbarItem->setImage("/images/exit.png"); $toolbarItem->setImage2("/images/exit_f2.png"); $toolbar = new IcfToolbar(); $toolbar->addToolbarItem($toolbarItem); // Menu support $menu = new IcfMenu(); // Only work it if the session is valid $session = new Session(); if ($session->isValid() == true) { $user = $session->getSessionUser(); // Classes whose objects the user can create $baseClassMapper = new BaseClassMapper(); $classes = $baseClassMapper->findByPermission(Action::ADD_OBJECTS_ACTION(), $user); $menu->setContents($classes); // The folders $folderMapper = new FolderMapper(); $rootFolder = $folderMapper->getRoot(); $folderArray = array(0 => $rootFolder); $menu->setFolders($folderArray); } // Set the generated content in the context of this request (available for client pages to change it) $this->setText($text); $this->setToolbar($toolbar); $this->setMenu($menu); }
/** * Shows the home view */ function show_view() { // Sets the title $this->tpl->assign('pageTitle', $this->text['pending']); // Add items to toolbar $toolbar =& $this->icfTemplating->getToolbar(); $ti = new icfToolbarItem(); $ti->setName("publishButton"); $ti->setTitle($this->text["publish"]); $ti->setUrl("#"); $ti->setImage("/images/publish.png"); $ti->setImage2("/images/publish_f2.png"); $ti->setOnclick("publishButton_onClick()"); $toolbar->addToolbarItem($ti); // Set toolbar $this->icfTemplating->setToolbar($toolbar); // Get the pending objects $objectMapper = new ObjectMapper(); $objects = $objectMapper->findPending(); $this->controllerData["objects"] = $objects; $this->tpl->assign("controllerData", $this->controllerData); $this->tpl->display("pending.tpl.php"); }
/** * Adds the necesary items to the toolbar */ function constructToolbar() { $toolbar =& $this->getToolbar(); $ti = new icfToolbarItem(); $ti->setName("delete"); $ti->setTitle($this->text["delete"]); $ti->setUrl("#"); $ti->setOnclick("deleteButton_onClick()"); $ti->setImage("/images/delete.png"); $ti->setImage2("/images/delete_f2.png"); $toolbar->addToolbarItem($ti); $ti = new icfToolbarItem(); $ti->setName("edit"); $ti->setTitle($this->text["edit"]); $ti->setUrl("#"); $ti->setOnclick("editButton_onClick()"); $ti->setImage("/images/edit.png"); $ti->setImage2("/images/edit_f2.png"); $toolbar->addToolbarItem($ti); $ti = new icfToolbarItem(); $ti->setName("add"); $ti->setTitle($this->text["add"]); $ti->setUrl("#"); $ti->setOnclick("addButton_onClick()"); $ti->setImage("/images/new.png"); $ti->setImage2("/images/new_f2.png"); $toolbar->addToolbarItem($ti); $ti = new icfToolbarItem(); $ti->setName("publish"); $ti->setTitle($this->text["publish"]); $ti->setUrl("#"); $ti->setOnclick("publishButton_onClick()"); $ti->setImage("/images/publish.png"); $ti->setImage2("/images/publish_f2.png"); $toolbar->addToolbarItem($ti); $ti = new icfToolbarItem(); $ti->setName("unpublish"); $ti->setTitle($this->text["unpublish"]); $ti->setUrl("#"); $ti->setOnclick("unpublishButton_onClick()"); $ti->setImage("/images/unpublish.png"); $ti->setImage2("/images/unpublish_f2.png"); $toolbar->addToolbarItem($ti); // Set toolbar $this->setToolbar($toolbar); }
/** * Adds the necesary items to the toolbar */ function setUpdateToolbar() { $toolbar =& $this->icfTemplating->getToolbar(); $ti = new icfToolbarItem(); $ti->setName("cancel"); $ti->setTitle($this->text["cancel"]); $ti->setUrl("#"); $ti->setImage("/images/cancel.png"); $ti->setImage2("/images/cancel_f2.png"); $ti->setOnclick("cancel_onClick()"); $toolbar->addToolbarItem($ti); $ti = new icfToolbarItem(); $ti->setName("update"); $ti->setTitle($this->text["save"]); $ti->setUrl("#"); $ti->setImage("/images/save.png"); $ti->setImage2("/images/save_f2.png"); $ti->setOnclick("update_onClick()"); $toolbar->addToolbarItem($ti); // Set toolbar $this->icfTemplating->setToolbar($toolbar); }
/** * Sets the toolbar for the view */ function setFolderViewToolbar() { $toolbar =& $this->getToolbar(); $toolbarItem = new icfToolbarItem(); $toolbarItem->setName("delete"); $toolbarItem->setTitle($this->text["delete"]); $toolbarItem->setUrl("#"); $toolbarItem->setOnclick("deleteButton_onClick()"); $toolbarItem->setImage("/images/delete.png"); $toolbarItem->setImage2("/images/delete_f2.png"); $toolbar->addToolbarItem($toolbarItem); $toolbarItem = new icfToolbarItem(); $toolbarItem->setName("edit"); $toolbarItem->setTitle($this->text["edit"]); $toolbarItem->setUrl("#"); $toolbarItem->setOnclick("editButton_onClick()"); $toolbarItem->setImage("/images/edit.png"); $toolbarItem->setImage2("/images/edit_f2.png"); $toolbar->addToolbarItem($toolbarItem); // Set toolbar $this->setToolbar($toolbar); }
/** * Sets the toolbar for the view */ function setUpdateFolderViewToolbar() { $toolbar =& $this->getToolbar(); $toolbarItem = new icfToolbarItem(); $toolbarItem->setName("cancel"); $toolbarItem->setTitle($this->text["cancel"]); $toolbarItem->setUrl("#"); $toolbarItem->setOnclick("cancelButton_onClick()"); $toolbarItem->setImage("/images/cancel.png"); $toolbarItem->setImage2("/images/cancel_f2.png"); $toolbar->addToolbarItem($toolbarItem); $toolbarItem = new icfToolbarItem(); $toolbarItem->setName("update"); $toolbarItem->setTitle($this->text["save"]); $toolbarItem->setUrl("#"); $toolbarItem->setOnclick("updateButton_onClick()"); $toolbarItem->setImage("/images/save.png"); $toolbarItem->setImage2("/images/save_f2.png"); $toolbar->addToolbarItem($toolbarItem); // Set toolbar $this->setToolbar($toolbar); }