Exemple #1
0
 public function __construct()
 {
     $this->view = ViewManager::getInstance();
     // get the current user and put it to the view
     if (session_status() == PHP_SESSION_NONE) {
         session_start();
     }
     if (isset($_SESSION["currentuser"])) {
         $this->currentUser = new User(NULL, $_SESSION["currentuser"]);
         //add current user to the view, since some views require it
         $usermapper = new UserMapper();
         $this->tipo = $usermapper->buscarPorLogin($_SESSION["currentuser"]);
         /* print_r($this->tipo);
            die();*/
         $this->view->setVariable("tipo", $this->tipo);
         $this->view->setVariable("currentusername", $this->currentUser->getLogin());
     }
     if (isset($_SESSION["currentcod1"]) && isset($_SESSION["currentcod2"]) && isset($_SESSION["currentcod3"])) {
         $codigomapper1 = new CodigoMapper();
         $this->currentCod1 = $codigomapper1->buscarPinchoPorCodigo($_SESSION["currentcod1"]);
         $codigomapper2 = new CodigoMapper();
         $this->currentCod2 = $codigomapper2->buscarPinchoPorCodigo($_SESSION["currentcod2"]);
         $codigomapper3 = new CodigoMapper();
         $this->currentCod3 = $codigomapper3->buscarPinchoPorCodigo($_SESSION["currentcod3"]);
     }
 }
Exemple #2
0
 /**
  * handle admin overview request
  */
 private function handleAdminOverview()
 {
     $view = ViewManager::getInstance();
     $log = Logger::getInstance();
     $logfile = $log->getLogFile();
     if ($view->isType(self::VIEW_FILE)) {
         $request = Request::getInstance();
         $extension = ".log";
         $filename = $request->getDomain() . $extension;
         header("Content-type: application/{$extension}");
         header("Content-Length: " . filesize($logfile));
         // stupid bastards of microsnob: ie does not like attachment option
         $browser = $request->getValue('HTTP_USER_AGENT', Request::SERVER);
         if (strstr($browser, 'MSIE')) {
             header("Content-Disposition: filename=\"{$filename}\"");
         } else {
             header("Content-Disposition: attachment; filename=\"{$filename}\"");
         }
         readfile($logfile);
         exit;
     } else {
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         $template->setVariable('logfile', nl2br(file_get_contents($logfile)), false);
         $url = new Url(true);
         $url->setParameter($view->getUrlId(), self::VIEW_FILE);
         $template->setVariable('href_export', $url->getUrl(true), false);
         $this->template[$this->director->theme->getConfig()->main_tag] = $template;
     }
 }
Exemple #3
0
 public function __construct()
 {
     $this->view = ViewManager::getInstance();
     if (session_status() == PHP_SESSION_NONE) {
         session_start();
     }
     if (isset($_SESSION["currentuser"])) {
         $this->currentUser = $_SESSION["currentuser"];
         $this->view->setVariable("currentusername", $this->currentUser);
     }
 }
Exemple #4
0
 /**
  * Handles data coming from a get request 
  * @param array HTTP request
  */
 public function handleHttpGetRequest()
 {
     $viewManager = ViewManager::getInstance();
     if ($viewManager->isType(ViewManager::OVERVIEW) && $this->director->isAdminSection()) {
         $viewManager->setType(ViewManager::ADMIN_OVERVIEW);
     }
     switch ($viewManager->getType()) {
         default:
             $this->handleAdminOverviewGet();
             break;
     }
 }
Exemple #5
0
 public function __construct()
 {
     $this->view = ViewManager::getInstance();
     // get the current user and put it to the view
     if (session_status() == PHP_SESSION_NONE) {
         session_start();
     }
     if (isset($_SESSION["currentuser"])) {
         $this->currentUser = new User($_SESSION["currentuser"]);
         //add current user to the view, since some views require it
         $this->view->setVariable("currentusername", $this->currentUser->getUsername());
     }
 }
 public function __construct()
 {
     $this->view = ViewManager::getInstance();
     // get the current user and put it to the view
     if (session_status() == PHP_SESSION_NONE) {
         session_start();
     }
     //inicializa la variable
     $this->friendDAO = new FriendDAO();
     if (isset($_SESSION["currentuser"])) {
         //En la sesion de currentuser se encuentra todo el usuario
         //ya que al hacer el login se introdujo todo el usuario en la sesion
         $this->currentUser = $_SESSION["currentuser"];
         $this->view->setVariable("currentusername", $this->currentUser);
         //consigue el numero total de solicitudes de amistad
         $numSolicitudes = $this->friendDAO->getNumSolicitudes($this->currentUser->getEmail());
         //Carga el num solicitudes en la vista
         $this->view->setVariable("numSolicitudes", $numSolicitudes);
     }
 }
Exemple #7
0
 /**
  * handle tree delete
  */
 private function handleDeleteGet()
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(self::VIEW_DELETE);
     if (!$request->exists('ip')) {
         throw new Exception('id is missing.');
     }
     $ip = $request->getValue('ip');
     $template->setVariable('ip', $ip);
     $template->setVariable($this->getDetail(array('ip' => $ip)));
     $this->director->theme->handleAdminLinks($template);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #8
0
 /**
  * handle tree edit
  */
 private function handleTreeEditGet($retrieveFields = true)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_EDIT);
     if (!$request->exists('tree_id')) {
         throw new Exception('Node ontbreekt.');
     }
     if (!$request->exists('tag')) {
         throw new Exception('Tag ontbreekt.');
     }
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $key = array('tree_id' => $tree_id, 'tag' => $tag);
     $fields = array();
     if ($retrieveFields) {
         $fields = $this->exists($key) ? $this->getDetail($key) : $this->getFields(SqlParser::MOD_INSERT);
     } else {
         $fields = $this->getFields(SqlParser::MOD_UPDATE);
     }
     // get all tree nodes which have plugin modules
     $site = new SystemSite();
     $tree = $site->getTree();
     $treelist = $tree->getList($tree_id);
     foreach ($treelist as &$item) {
         $item['name'] = $tree->toString($item['id'], '/', 'name');
     }
     $template->setVariable('cbo_tree_id', Utils::getHtmlCombo($treelist, $fields['ref_tree_id']));
     $this->setFields($fields);
     $template->setVariable($this->getFields(SqlParser::MOD_UPDATE), NULL, false);
     $template->setVariable('tree_id', $tree_id, false);
     $template->setVariable('tag', $tag, false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #9
0
 public function save($content, $postfix = '')
 {
     // only save if caching is enabled in config file
     if (!$this->isCacheEnabled()) {
         return;
     }
     $view = ViewManager::getInstance();
     $url = md5($this->url . $postfix . $view->getType());
     $filename = $this->path . $url;
     if (!($fh = fopen($filename, "w"))) {
         throw new Exception("could not open file {$filename} for writing. in " . __CLASS__ . " " . __FUNCTION__);
     }
     fputs($fh, $content);
     fclose($fh);
     chmod($filename, 0644);
     return $filename;
 }
Exemple #10
0
 /**
  * handle conf 
  */
 private function handleConfGet($retrieveFields = true)
 {
     viewManager::getInstance()->setType(ViewManager::CONF_EDIT);
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setVariable('pageTitle', $this->description);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $detail = $this->getDetail(array());
     $fields = array();
     if ($retrieveFields) {
         $fields = $this->exists(array()) ? $detail : $this->getFields(SqlParser::MOD_INSERT);
     } else {
         $fields = $this->getFields(SqlParser::MOD_UPDATE);
     }
     $template->setVariable('cbo_display', Utils::getHtmlCombo(self::getDisplayTypeList(), $fields['display']));
     $this->setFields($fields);
     $template->setVariable($this->getFields(SqlParser::MOD_UPDATE));
     $template->setVariable('id', $detail ? $detail['id'] : '');
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #11
0
 /**
  * handle delete
  */
 private function handleAdminDeleteGet()
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     if (!$request->exists('id')) {
         throw new Exception('Gebruikersgroep ontbreekt.');
     }
     $id = intval($request->getValue('id'));
     $template->setVariable('id', $id, false);
     $template->setVariable('name', $this->getName(array('id' => $id)), false);
     $view = ViewManager::getInstance();
     $url = new Url(true);
     $url->setParameter($view->getUrlId(), ViewManager::ADMIN_OVERVIEW);
     $template->setVariable('href_back', $url->getUrl(true), false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #12
0
 /**
  * handle navigation for sub classes / pages
  */
 public function handleAdminSubLinks($keyName, $title, $addBreadcrumb = false)
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $template = new TemplateEngine();
     if (!$request->exists('nl_id')) {
         return;
     }
     $nl_id = $request->getValue('nl_id');
     $newsLetterName = $this->getName(array('id' => $nl_id));
     $template->setVariable('pageTitle', $newsLetterName, false);
     $tree_id = $request->getValue('tree_id');
     $tag = $request->getValue('tag');
     $template->setVariable('tree_id', $tree_id, false);
     $template->setVariable('tag', $tag, false);
     $template->setVariable('nl_id', $nl_id, false);
     if (!$addBreadcrumb) {
         return;
     }
     $url = new Url(true);
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     $url->setParameter('id', $nl_id);
     $url->setParameter($view->getUrlId(), ViewManager::TREE_EDIT);
     $breadcrumb = array('name' => $newsLetterName, 'path' => $url->getUrl(true));
     $this->addBreadcrumb($breadcrumb);
 }
Exemple #13
0
 /**
  * handle tree edit
  */
 private function handleTreeEditGet($retrieveFields = true)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_EDIT);
     if (!$request->exists('tree_id')) {
         throw new Exception('Node ontbreekt.');
     }
     if (!$request->exists('tag')) {
         throw new Exception('Tag ontbreekt.');
     }
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $key = array('tree_id' => $tree_id, 'tag' => $tag);
     $fields = array();
     if ($retrieveFields) {
         if ($this->exists($key)) {
             $fields = $this->getDetail($key);
             $fields['online'] = $fields['online'] ? strftime('%Y-%m-%d', $fields['online']) : '';
             $fields['offline'] = $fields['offline'] ? strftime('%Y-%m-%d', $fields['offline']) : '';
         } else {
             $fields = $this->getFields(SqlParser::MOD_INSERT);
         }
     } else {
         $fields = $this->getFields(SqlParser::MOD_UPDATE);
     }
     // get all tree nodes which have plugin modules
     $sitePlugin = $this->director->siteManager->systemSite->getSitePlugin();
     $tree = $this->plugin->getReferer()->getTree();
     $searchcriteria = array('classname' => 'Attachment', 'plugin_type' => Attachment::TYPE_DEFAULT);
     $treeplugin = $sitePlugin->getList($searchcriteria);
     $treelist = array();
     foreach ($treeplugin['data'] as $item) {
         if (!$tree->exists($item['tree_id'])) {
             continue;
         }
         $treelist[] = array('id' => $item['tree_id'], 'name' => $tree->toString($item['tree_id'], '/', 'name'));
     }
     // get all selected tree node connections
     $treeRef = new AttachmentTreeRef();
     $treeRefTmp = $treeRef->getList($key);
     $treeRefLink = array();
     foreach ($treeRefTmp['data'] as $item) {
         $treeRefLink[] = $item['ref_tree_id'];
     }
     $template->setVariable('ref_tree_id', Utils::getHtmlCheckbox($treelist, $treeRefLink, 'ref_tree_id', '<br />'));
     $datefields = array();
     $datefields[] = array('dateField' => 'online', 'triggerElement' => 'online');
     $datefields[] = array('dateField' => 'offline', 'triggerElement' => 'offline');
     Utils::getDatePicker($this->director->theme, $datefields);
     $this->setFields($fields);
     $template->setVariable($fields, NULL, false);
     $template->setVariable('tree_id', $tree_id, false);
     $template->setVariable('tag', $tag, false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #14
0
 private function handleExtensionPost()
 {
     $request = Request::getInstance();
     $template = new TemplateEngine();
     $view = ViewManager::getInstance();
     $this->renderExtension = true;
     if (!$request->exists('ext_id')) {
         throw new Exception('Extension ontbreekt.');
     }
     $id = intval($request->getValue('ext_id'));
     $template->setVariable('ext_id', $id, false);
     $url = new Url(true);
     $url_back = clone $url;
     $url_back->setParameter($view->getUrlId(), ViewManager::ADMIN_OVERVIEW);
     $url_back->clearParameter('ext_id');
     $extension = $this->director->extensionManager->getExtensionFromId(array('id' => $id));
     $extension->setReferer($this);
     $this->director->theme->handleAdminLinks($template, $this->getName(array('id' => $id)), $url_detail);
     $extension->handleHttpPostRequest();
 }
Exemple #15
0
    /**
     * handle config
     */
    private function handleConfigGet($retrieveFields = true)
    {
        $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
        $request = Request::getInstance();
        if (!$request->exists('id')) {
            throw new Exception('Thema ontbreekt.');
        }
        $id = intval($request->getValue('id'));
        $template->setVariable('id', $id, false);
        $key = array('id' => $id);
        $themedetail = $this->getDetail($key);
        $theme = $this->director->themeManager->getThemeFromId($key);
        if ($retrieveFields) {
            $fileTpl = file_get_contents($theme->getTemplateFile());
            $fileIni = file_get_contents($theme->getConfigFile());
            $fileCss = file_get_contents($theme->getStyleSheetFile());
        } else {
            $fileTpl = $request->getValue('file_tpl');
            $fileIni = $request->getValue('file_ini');
            $fileCss = $request->getValue('file_css');
        }
        $template->setVariable('file_tpl', $fileTpl, false);
        $template->setVariable('file_ini', $fileIni, false);
        $template->setVariable('file_css', $fileCss, false);
        $theme = $this->director->theme;
        $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/editarea/edit_area/edit_area_full.js"></script>');
        $theme->addHeader('<script type="text/javascript">
editAreaLoader.init({ 	id: "area1", 
							start_highlight: true, 
							allow_toggle: true, 
							allow_resize: true,
							language: "en", 
							syntax: "php", 
							syntax_selection_allow: "css,html,js,php", 
					});

editAreaLoader.init({ 	id: "area2", 
							start_highlight: true, 
							allow_toggle: true, 
							allow_resize: true,
							language: "en", 
							syntax: "html", 
							syntax_selection_allow: "css,html,js,php", 
					});

editAreaLoader.init({ 	id: "area3", 
							start_highlight: true, 
							allow_toggle: true, 
							allow_resize: true,
							language: "en", 
							syntax: "css", 
							syntax_selection_allow: "css,html,js,php", 
					});
</script>');
        $template->setVariable('templateVars', $theme->getTemplateVars(), false);
        $view = ViewManager::getInstance();
        $url = new Url(true);
        $url_back = clone $url;
        $url_back->setParameter($view->getUrlId(), ViewManager::ADMIN_OVERVIEW);
        $template->setVariable('href_back', $url_back->getUrl(true), false);
        $theme->addBreadcrumb(array('name' => $themedetail['name'], 'path' => $url_back->getUrl(true)));
        $theme->addBreadcrumb(array('name' => $view->getName(), 'path' => $url->getUrl(true)));
        $this->template[$this->director->theme->getConfig()->main_tag] = $template;
    }
Exemple #16
0
 /**
  * Manages form output rendering
  * @param string Smarty template object
  * @see GuiProvider::renderForm
  */
 public function renderForm($theme)
 {
     $view = ViewManager::getInstance();
     $template = $theme->getTemplate();
     $template->setVariable($view->getUrlId(), $view->getName(), false);
     $theme->addStylesheet(file_get_contents($this->plugin->getHtdocsPath(true) . 'css/style.css.in'));
     foreach ($this->template as $key => $value) {
         $template->setVariable($key, $value, false);
     }
 }
Exemple #17
0
    /**
     * handle conf edit
     */
    private function handleConfEditGet($retrieveFields = true)
    {
        viewManager::getInstance()->setType(ViewManager::CONF_EDIT);
        $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
        $template->setVariable('pageTitle', $this->description);
        $request = Request::getInstance();
        $view = ViewManager::getInstance();
        $detail = $this->getDetail(array());
        $fields = array();
        if ($retrieveFields) {
            $fields = $this->exists(array()) ? $detail : $this->getFields(SqlParser::MOD_INSERT);
        } else {
            $fields = $this->getFields(SqlParser::MOD_UPDATE);
        }
        $this->setFields($fields);
        $template->setVariable($this->getFields(SqlParser::MOD_UPDATE));
        $template->setVariable('id', $detail ? $detail['id'] : '');
        $template->setVariable('cbo_display', Utils::getHtmlCombo($this->getDisplayTypeList(), $fields['display']));
        $template->setVariable('cbo_display_overview', Utils::getHtmlCombo($this->getDisplayOverviewList(), $fields['display_overview']));
        $template->setVariable('cbo_comment_display', Utils::getHtmlCombo(GalleryComment::getDisplayTypeList(), $fields['comment_display']));
        // add source code editor
        $theme = $this->director->theme;
        $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/editarea/edit_area/edit_area_full.js"></script>');
        $theme->addJavascript('
editAreaLoader.init({ 	id: "area1", 
							start_highlight: true, 
							allow_toggle: true, 
							allow_resize: true,
							language: "en", 
							syntax: "php", 
							syntax_selection_allow: "css,html,js,php", 
					});
');
        $this->template[$this->director->theme->getConfig()->main_tag] = $template;
    }
Exemple #18
0
 /**
  * handle resize
  */
 private function handleResizeGet()
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(Calendar::VIEW_IMAGE_RESIZE);
     $auth = Authentication::getInstance();
     $template->setVariable('username', $auth->getUsername(), false);
     $this->handleTreeSettings($template);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #19
0
 /**
  * Manages form output rendering
  * @param string Smarty template object
  * @see GuiProvider::renderForm
  */
 public function renderForm($theme)
 {
     $view = ViewManager::getInstance();
     $template = $theme->getTemplate();
     $template->setVariable($view->getUrlId(), $view->getName(), false);
     // parse rpc javascript to set variables
     $theme->addFileVar('poll_htdocs_path', $this->plugin->getHtdocsPath());
     $rpcfile_src = $this->plugin->getHtdocsPath(true) . "js/rpc.js.in";
     $theme->addJavascript($theme->fetchFile($rpcfile_src));
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/prototype.js"></script>');
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/jsxmlrpc/lib/xmlrpc_lib.js"></script>');
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/jsxmlrpc/lib/xmlrpc_wrappers.js"></script>');
     if ($this->reference) {
         foreach ($this->reference as $object) {
             $object->renderForm($theme);
         }
     }
     foreach ($this->template as $key => $value) {
         $template->setVariable($key, $value, false);
     }
 }
Exemple #20
0
 /**
  * handle export 
  */
 private function handleExport()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $cache = Cache::getInstance();
     $filename = strtolower($this->getClassName()) . ".csv";
     $csvContent = '';
     if (!$cache->isCached($filename)) {
         require_once DIF_ROOT . "utils/CsvFile.php";
         // handle searchcriteria
         $search = new SearchManager();
         $search->setUrl($this->pagerUrl);
         $search->setExclude($this->pagerKey);
         $search->setParameter('search');
         $search->saveList();
         $searchcriteria = $search->getSearchParameterList();
         $exportlist = array();
         $list = $this->getList($searchcriteria);
         foreach ($list['data'] as $item) {
             $row = array_intersect_key($item, $this->exportColumns);
             $row['password'] = '';
             $row['role'] = $this->getRoleDesc($row['role']);
             $exportlist[] = $row;
         }
         $csvFile = new CsvFile();
         $csvContent = join("\n", $csvFile->array2csv($exportlist));
         $cache->save($csvContent, $filename);
     } else {
         $csvContent = $cache->getCache($filename);
     }
     header("Content-type: text/csv");
     header("Content-Disposition: attachment; filename=\"{$filename}\"");
     echo $csvContent;
     exit;
 }
 /**
  * handle import
  */
 private function handleImportGet()
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(NewsLetter::VIEW_FILE_IMPORT);
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $nl_id = intval($request->getValue('nl_id'));
     $template->setVariable('nl_id', $nl_id, false);
     $template->setVariable('importPath', $this->director->getImportPath(), false);
     $this->handleTreeSettings($template);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #22
0
 private function renderBreadcrumb()
 {
     $breadcrumb = $this->tree->getAncestorList($this->tree->getCurrentId(), true);
     $theme = $this->director->theme;
     $view = ViewManager::getInstance();
     $url = new Url();
     $url->useCurrent(false);
     $url->setParameter($view->getUrlId(), ViewManager::ADMIN_OVERVIEW);
     foreach ($breadcrumb as &$item) {
         $url->setParameter('id', $item['id']);
         $item['path'] = $url->getUrl(true);
         $theme->addBreadcrumb($item);
     }
     //$theme->mergeBreadcrumb($this->breadcrumb);
 }
Exemple #23
0
 /**
  * handle user
  */
 private function handleUserGet($retrieveFields = true)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     if (!$request->exists('id')) {
         throw new Exception('User group is missing.');
     }
     $id = intval($request->getValue('id'));
     $template->setVariable('id', $id, false);
     $key = array('id' => $id);
     $user = $this->director->adminManager->getPlugin('User');
     $usr_used = $request->getValue('usr_used');
     if ($retrieveFields) {
         $searchcriteria = array('grp_id' => $id);
         $tmp = $user->getList($searchcriteria);
         $usr_used = $tmp['data'];
     }
     $search_used = $usr_used ? array('id' => $usr_used) : NULL;
     $search_free = $usr_used ? array('no_id' => $usr_used) : NULL;
     $user_used = $usr_used ? $user->getList($search_used) : array('data' => '');
     $user_free = $user->getList($search_free);
     $template->setVariable('cbo_usr_used', Utils::getHtmlCombo($user_used['data'], NULL, NULL, 'id', 'formatName'));
     $template->setVariable('cbo_usr_free', Utils::getHtmlCombo($user_free['data'], NULL, NULL, 'id', 'formatName'));
     $view = ViewManager::getInstance();
     $url = new Url(true);
     $breadcrumb = array('name' => $view->getName(), 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     $url->setParameter($view->getUrlId(), ViewManager::ADMIN_OVERVIEW);
     $template->setVariable('href_back', $url->getUrl(true), false);
     $template->setVariable('title', $this->getName($key), false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #24
0
 /**
  * handle tree edit
  */
 private function handleTreeEditGet($retrieveFields = true)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_EDIT);
     if (!$request->exists('tree_id')) {
         throw new Exception('Node ontbreekt.');
     }
     if (!$request->exists('tag')) {
         throw new Exception('Tag ontbreekt.');
     }
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $key = array('tree_id' => $tree_id, 'tag' => $tag);
     $fields = array();
     if ($retrieveFields) {
         $fields = $this->exists($key) ? $this->getDetail($key) : $this->getFields(SqlParser::MOD_INSERT);
     } else {
         $fields = $this->getFields(SqlParser::MOD_UPDATE);
     }
     $this->setFields($fields);
     $template->setVariable($fields, NULL, false);
     $template->setVariable('tree_id', $tree_id, false);
     $template->setVariable('tag', $tag, false);
     $template->setVariable('cbo_type', Utils::getHtmlCombo($this->getMenuTypeList(), $fields['type'], 'geen submenu'));
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
Exemple #25
0
 /**
  * handle optin confirm
  */
 private function handleOptin()
 {
     $taglist = $this->getTagList();
     if (!$taglist) {
         return;
     }
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $objUser = $this->getObject(self::TYPE_USER);
     $objSettings = $this->getObject(self::TYPE_SETTINGS);
     try {
         if (!$request->exists('key')) {
             throw new Exception('Parameter does not exist.');
         }
         $keyValue = $request->getValue('key');
         if (!$keyValue) {
             throw new Exception('Parameter is empty.');
         }
         $key = array('optin' => $keyValue);
         $objUser->enable($key);
         // retrieve settings to get redirect location
         $searchcriteria = array();
         foreach ($taglist as $item) {
             $searchcriteria = array('tree_id' => $item['tree_id'], 'tag' => $item['tag']);
         }
         $settings = $objSettings->getSettings($searchcriteria['tree_id'], $searchcriteria['tag']);
         $location = $settings['optin_tree_id'] ? $this->director->tree->getPath($settings['optin_tree_id']) : '/';
         header("Location: {$location}");
         exit;
     } catch (Exception $e) {
         $template = new TemplateEngine();
         $template->setVariable('newsLetterErrorMessage', $e->getMessage(), false);
         $this->log->info($e->getMessage());
         $view->setType(ViewManager::OVERVIEW);
         $this->handleHttpGetRequest();
     }
 }
Exemple #26
0
 /**
  * Manages form output rendering
  * @param string Smarty template object
  * @see GuiProvider::renderForm
  */
 public function renderForm($theme)
 {
     $this->director->callObjectsImplementing('PluginProvider', 'renderPluginRequest', array($theme));
     $view = ViewManager::getInstance();
     $template = $theme->getTemplate();
     $template->setVariable($view->getUrlId(), $view->getName(), false);
     foreach ($this->template as $key => $value) {
         $template->setVariable($key, $value, false);
     }
 }
Exemple #27
0
 /**
  * Manages form output rendering
  * @param string Smarty template object
  * @see GuiProvider::renderForm
  */
 public function renderForm($theme)
 {
     $view = ViewManager::getInstance();
     $template = $theme->getTemplate();
     $template->setVariable($view->getUrlId(), $view->getName(), false);
     foreach ($this->template as $key => $value) {
         $template->setVariable($key, $value, false);
     }
 }
Exemple #28
0
 private function handleActivatePost()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $systemUser = new SystemUser();
     $loginRequest = new LoginRequest();
     $view->setType(self::VIEW_ACTIVATE);
     try {
         if (!$request->exists('tag')) {
             throw new Exception('Tag ontbreekt.');
         }
         if (!$request->exists('key')) {
             throw new Exception('Key is missing.');
         }
         $key = $request->getValue('key');
         if (!$key) {
             throw new Exception('Key is missing.');
         }
         // get request details
         $requestKey = array('request_key' => $key);
         if (!$loginRequest->exists($requestKey)) {
             throw new Exception('Request does not exist.');
         }
         $requestInfo = $loginRequest->getDetail($requestKey);
         // get user details
         $userKey = array('id' => $requestInfo['usr_id']);
         if (!$systemUser->exists($userKey)) {
             throw new Exception('Request does not exist.');
         }
         $user = $systemUser->getDetail(array('id' => $requestInfo['usr_id']));
         $tree = $this->director->tree;
         $tag = $request->getValue('tag');
         $tree_id = $tree->getCurrentId();
         $key = array('tree_id' => $tree_id, 'tag' => $tag);
         $settings = $this->getDetail($key);
         // hide old password and change with password validation
         $newpass1 = $request->getValue('newpass1');
         $newpass2 = $request->getValue('newpass2');
         if (!$newpass1 && !$newpass2) {
             throw new Exception("Password is missing.");
         }
         if ($newpass1 == $newpass2) {
             $systemUser->setPassword($userKey, $newpass1);
         } else {
             throw new Exception("Passwords do not match.");
         }
         // delete request
         //$loginRequest->delete($requestKey);
         $referer = $settings['fin_tree_id'] ? $tree->getPath($settings['fin_tree_id'], '/', Tree::TREE_ORIGINAL) : ($request->exists('referer') ? $request->getValue('referer') : '/');
         header("Location: {$referer}");
         exit;
     } catch (Exception $e) {
         $template = new TemplateEngine();
         $template->setVariable('formError', $e->getMessage(), false);
         $this->handleHttpGetRequest();
     }
 }
Exemple #29
0


<?php 
include "includesCSS/includeCss.html";
//file: view/posts/view.php
require_once __DIR__ . "/../../core/ViewManager.php";
$view = ViewManager::getInstance();
$premios = $view->getVariable("premios");
$currentuser = $view->getVariable("currentusername");
$view->setVariable("nombre", "View Premio");
include "view/users/menuSuperior.php";
?>


<section class="gallery                                                                                                                                                                              " id="gallery">
		<div class="container">
			<div class="heading text-center">
				<img class="dividerline" src="archivos/sep.png" alt="">
				<h2>Premios 2015</h2>
				<img class="dividerline" src="archivos/sep.png" alt="">
			</div>
			
			<div id="grid-gallery" class="grid-gallery">
					<section class="grid-wrap">
						<ul  class="grid">
						 <li class="grid-sizer "></li><!-- for Masonry column width -->	
	<!--inicio -->		<?php 
foreach ($premios as $premio) {
    ?>
							<li class=" col-md-3">
Exemple #30
0
 /**
  * Manages form output rendering
  * @param string Smarty template object
  * @see GuiProvider::renderForm
  */
 public function renderForm($theme)
 {
     $view = ViewManager::getInstance();
     $template = $theme->getTemplate();
     $template->setVariable($view->getUrlId(), $view->getName(), false);
     // parse rpc javascript to set variables
     $theme->addFileVar('calendar_htdocs_path', $this->plugin->getHtdocsPath());
     $rpcfile_src = $this->plugin->getHtdocsPath(true) . "js/rpc.js.in";
     $theme->addJavascript($theme->fetchFile($rpcfile_src));
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/prototype.js"></script>');
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/jsxmlrpc/lib/xmlrpc_lib.js"></script>');
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/jsxmlrpc/lib/xmlrpc_wrappers.js"></script>');
     // render comments
     $objComment = $this->plugin->getObject(Calendar::TYPE_COMMENT);
     $objComment->renderForm($theme);
     $objAttachment = $this->plugin->getObject(Calendar::TYPE_ATTACHMENT);
     $objAttachment->renderForm($theme);
     $objImage = $this->plugin->getObject(Calendar::TYPE_IMAGE);
     $objImage->renderForm($theme);
     foreach ($this->template as $key => $value) {
         $template->setVariable($key, $value, false);
     }
 }