当前位置: 首页>>代码示例>>PHP>>正文


PHP Url::clearParameter方法代码示例

本文整理汇总了PHP中Url::clearParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::clearParameter方法的具体用法?PHP Url::clearParameter怎么用?PHP Url::clearParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Url的用法示例。


在下文中一共展示了Url::clearParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handleDetail

 /**
  * handle detail request
  */
 private function handleDetail()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     // it makes no sense to have multiple tags for this plugin.
     // if someone did it, you get strange results and he probably can figure out why.. no multiple detail stuff in 1 page supported!
     // so take a shot and get the first tag to set the content
     $taglist = $this->plugin->getTagList(array('plugin_type' => Calendar::TYPE_ARCHIVE));
     if (!$taglist) {
         return;
     }
     $taginfo = current($taglist);
     // process attachments
     $attachment = $this->plugin->getObject(Calendar::TYPE_ATTACHMENT);
     $attachment->handleHttpGetRequest();
     // process images
     $image = $this->plugin->getObject(Calendar::TYPE_IMAGE);
     $image->handleHttpGetRequest();
     // clear subtitle
     $view->setName('');
     if (!$request->exists('id')) {
         throw new Exception('Calendar id is missing.');
     }
     $id = intval($request->getValue('id'));
     $key = array('id' => $id, 'active' => true, 'finished' => true);
     $overview = $this->plugin->getObject(Calendar::TYPE_DEFAULT);
     if (!$overview->exists($key)) {
         return;
     }
     $detail = $overview->getDetail($key);
     // check if tree node of cal item is accessable
     $tree = $this->director->tree;
     if (!$tree->exists($detail['tree_id'])) {
         throw new HttpException('404');
     }
     $objSettings = $this->plugin->getObject(Calendar::TYPE_SETTINGS);
     $settings = $objSettings->getSettings($detail['tree_id'], $detail['tag']);
     if ($detail['thumbnail']) {
         $img = new Image($detail['thumbnail'], $this->plugin->getContentPath(true));
         $detail['thumbnail'] = array('src' => $this->plugin->getContentPath(false) . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
     }
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setPostfix($detail['tag']);
     // disable cache because we want to count visits
     $template->setCacheable(false);
     Cache::disableCache();
     // update view counter
     $overview->updateCount($key);
     // overwrite default naming
     $template->setVariable('pageTitle', $detail['name'], false);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter($view->getUrlId(), ViewManager::OVERVIEW);
     $template->setVariable('href_back', $url->getUrl(true), false);
     $breadcrumb = array('name' => $detail['name'], 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     $template->setVariable('cal', $detail, false);
     $template->setVariable('settings', $settings);
     $template->setVariable('calsettings', $settings, false);
     // get settings
     if ($settings['comment']) {
         // process comments
         $comment = $this->plugin->getObject(Calendar::TYPE_COMMENT);
         $comment->setSettings($settings);
         $comment->handleHttpGetRequest();
     }
     $this->template[$taginfo['tag']] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:71,代码来源:CalendarArchive.php

示例2: handleTreeOverview

 /**
  * handle tree overview
  */
 private function handleTreeOverview()
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(Calendar::VIEW_IMAGE_OVERVIEW);
     if (!$request->exists('cal_id')) {
         throw new Exception('Calendar is missing.');
     }
     if (!$request->exists('tree_id')) {
         throw new Exception('Node is missing.');
     }
     if (!$request->exists('tag')) {
         throw new Exception('Tag is missing.');
     }
     $cal_id = intval($request->getValue('cal_id'));
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $key = array('cal_id' => $cal_id);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('cal_id', $cal_id);
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // add breadcrumb item
     $this->director->theme->handleAdminLinks($template);
     // create urls
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), Calendar::VIEW_IMAGE_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true), false);
     $url_import = clone $url;
     $url_import->setParameter($view->getUrlId(), Calendar::VIEW_IMAGE_IMPORT);
     $template->setVariable('href_import', $url_import->getUrl(true), false);
     $url_resize = clone $url;
     $url_resize->setParameter($view->getUrlId(), Calendar::VIEW_IMAGE_RESIZE);
     $template->setVariable('href_resize', $url_resize->getUrl(true), false);
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), Calendar::VIEW_IMAGE_EDIT);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), Calendar::VIEW_IMAGE_DELETE);
     $list = $this->getList($key);
     foreach ($list['data'] as &$item) {
         $url_edit->setParameter('id', $item['id']);
         $url_del->setParameter('id', $item['id']);
         $item['href_edit'] = $url_edit->getUrl(true);
         $item['href_del'] = $url_del->getUrl(true);
         if ($item['thumbnail']) {
             $img = new Image($item['thumbnail'], $this->plugin->getContentPath(true));
             $item['thumbnail'] = array('src' => $this->plugin->getContentPath(false) . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
         }
     }
     $template->setVariable('list', $list, false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:57,代码来源:CalendarImage.php

示例3: handleBreadcrumb

 /**
  * handle breadcrumb
  */
 private function handleBreadcrumb($template)
 {
     $view = ViewManager::getInstance();
     $request = Request::getInstance();
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $template->setVariable('tree_id', $tree_id);
     $template->setVariable('tag', $tag);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter($view->getUrlId(), NewsLetter::VIEW_GROUP_OVERVIEW);
     $breadcrumb = array('name' => $view->getName(NewsLetter::VIEW_GROUP_OVERVIEW), 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     $this->director->theme->handleAdminLinks($template);
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:18,代码来源:NewsLetterGroup.php

示例4: handleTreeOverview

 /**
  * handle tree overview
  */
 private function handleTreeOverview()
 {
     $pagesize = 20;
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(Calendar::VIEW_COMMENT_OVERVIEW);
     $page = $this->getPage();
     if (!$request->exists('cal_id')) {
         throw new Exception('Nieuwsbericht ontbreekt.');
     }
     if (!$request->exists('tree_id')) {
         throw new Exception('Node ontbreekt.');
     }
     if (!$request->exists('tag')) {
         throw new Exception('Tag ontbreekt.');
     }
     $cal_id = intval($request->getValue('cal_id'));
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $key = array('cal_id' => $cal_id);
     $this->pagerUrl->addParameters($key);
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     // handle searchcriteria
     $search = new SearchManager();
     $search->setUrl($this->pagerUrl);
     $search->setExclude($this->pagerKey);
     $search->setParameter('search');
     $search->saveList();
     $searchcriteria = $search->getSearchParameterList();
     $searchcriteria = array_merge($searchcriteria, $key);
     // add breadcrumb item
     $this->director->theme->handleAdminLinks($template);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('cal_id', $cal_id);
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // create urls
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), Calendar::VIEW_COMMENT_EDIT);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), Calendar::VIEW_COMMENT_DELETE);
     $list = $this->getList($searchcriteria, $pagesize, $page);
     foreach ($list['data'] as &$item) {
         $url_edit->setParameter('id', $item['id']);
         $url_del->setParameter('id', $item['id']);
         $item['href_edit'] = $url_edit->getUrl(true);
         $item['href_del'] = $url_del->getUrl(true);
     }
     $template->setVariable('list', $list, false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:56,代码来源:CalendarComment.php

示例5: handleTreeOverview

 /**
  * handle tree overview
  */
 private function handleTreeOverview()
 {
     $pagesize = 20;
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_OVERVIEW);
     $page = $this->getPage();
     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);
     $this->pagerUrl->addParameters($key);
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // create urls
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), ViewManager::TREE_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true), false);
     $url_import = clone $url;
     $url_import->setParameter($view->getUrlId(), Attachment::VIEW_FILE_IMPORT);
     $template->setVariable('href_import', $url_import->getUrl(true), false);
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), ViewManager::TREE_EDIT);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), ViewManager::TREE_DELETE);
     // get settings
     $settings = $this->getSettings();
     $list = $this->getList($key, $pagesize, $page, $settings['display_order']);
     foreach ($list['data'] as &$item) {
         $url_edit->setParameter('id', $item['id']);
         $url_del->setParameter('id', $item['id']);
         $item['href_edit'] = $url_edit->getUrl(true);
         $item['href_del'] = $url_del->getUrl(true);
         if ($item['file']) {
             $item['file_url'] = $this->plugin->getFileUrl($item['id']);
         }
     }
     $template->setVariable('list', $list, false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:52,代码来源:AttachmentOverview.php

示例6: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $page = $this->getPage();
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     $view->setType(self::VIEW_OVERVIEW);
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setVariable('pageTitle', $this->description);
     if (!$request->exists('ext_id')) {
         throw new Exception('Extension is missing.');
     }
     $ext_id = intval($request->getValue('ext_id'));
     // handle searchcriteria
     $search = new SearchManager();
     $search->setUrl($this->pagerUrl);
     $search->setExclude($this->pagerKey);
     $search->setParameter('search');
     $search->setParameter('ext_id', $ext_id);
     $search->saveList();
     $searchcriteria = $search->getSearchParameterList();
     $url = new Url(true);
     $url->clearParameter('ip');
     $url->setParameter('ext_id', $ext_id);
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), self::VIEW_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true));
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), self::VIEW_EDIT);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), self::VIEW_DELETE);
     $list = $this->getList($searchcriteria, $this->pagesize, $page);
     foreach ($list['data'] as &$item) {
         $url_edit->setParameter('ip', $item['ip']);
         $url_del->setParameter('ip', $item['ip']);
         $item['href_edit'] = $url_edit->getUrl(true);
         $item['href_del'] = $url_del->getUrl(true);
         if ($item['suspect']) {
             $item['state'] = 'suspect';
         } elseif (!$item['activated']) {
             $item['state'] = 'expired';
         } else {
             $item['state'] = 'intruder';
         }
     }
     $template->setVariable('list', $list);
     $template->setVariable('searchparam', $search->getMandatoryParameterList());
     $template->setVariable('searchcriteria', $searchcriteria);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:53,代码来源:Intrusion.php

示例7: handleTreeOverview

 /**
  * handle tree overview
  */
 private function handleTreeOverview()
 {
     $pagesize = 20;
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_OVERVIEW);
     $page = $this->getPage();
     if (!$request->exists('tree_id')) {
         throw new Exception('Node is missing.');
     }
     if (!$request->exists('tag')) {
         throw new Exception('Tag is missing.');
     }
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $key = array('tree_id' => $tree_id, 'tag' => $tag);
     $this->pagerUrl->addParameters($key);
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     // handle searchcriteria
     $search = new SearchManager();
     $search->setUrl($this->pagerUrl);
     $search->setExclude($this->pagerKey);
     $search->setParameter('search');
     $search->saveList();
     $searchcriteria = $search->getSearchParameterList();
     $searchcriteria = array_merge($searchcriteria, $key);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->clearParameter('res_id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // create urls
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), ViewManager::TREE_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true), false);
     $url_conf = clone $url;
     $url_conf->setParameter($view->getUrlId(), Reservation::VIEW_CONFIG);
     $template->setVariable('href_conf', $url_conf->getUrl(true), false);
     $url_period = clone $url;
     $url_period->setParameter($view->getUrlId(), Reservation::VIEW_BLOCK_PERIOD_OVERVIEW);
     $template->setVariable('href_period', $url_period->getUrl(true), false);
     $url_usergroup = clone $url;
     $url_usergroup->setParameter($view->getUrlId(), Reservation::VIEW_USER_GROUP_OVERVIEW);
     $template->setVariable('href_usergroup', $url_usergroup->getUrl(true), false);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), ViewManager::TREE_DELETE);
     $list = $this->getList($searchcriteria, $pagesize, $page, self::ORDER_TIME_DESC | SqlParser::ORDER_DESC);
     foreach ($list['data'] as &$item) {
         $url_del->setParameter('id', $item['id']);
         $item['href_del'] = $url_del->getUrl(true);
     }
     $template->setVariable('list', $list, false);
     $template->setVariable('searchparam', $search->getMandatoryParameterList(), false);
     $template->setVariable('searchcriteria', $searchcriteria, false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:60,代码来源:ReservationOverview.php

示例8: handleEdit

 /**
  * handle overview
  */
 private function handleEdit($template, $usr_id)
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $template->setVariable('tree_id', $tree_id, false);
     $template->setVariable('tag', $tag, false);
     $user = $this->director->systemUser;
     $usr_used = $request->getValue('usr_used');
     // get list of users that have access to the reservation module
     $groupList = $this->getGroupList($tree_id);
     $theme = $this->director->theme;
     $theme->addJavascript(file_get_contents($this->plugin->getHtdocsPath(true) . 'js/multibox.js'));
     // get list of group owners
     if ($view->isType(Reservation::VIEW_USER_GROUP_NEW)) {
         $userList = $user->getList(array('grp_id' => $groupList));
         $template->setVariable('cbo_user', Utils::getHtmlCombo($userList['data'], $usr_id, 'select a user...', 'id', 'formatName'));
         $theme->addFileVar('reservation_htdocs_path', $this->plugin->getHtdocsPath());
         // parse rpc file to set variables
         $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/scriptaculous.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 ($view->isType(Reservation::VIEW_USER_GROUP_EDIT) || $request->getRequestType() == Request::POST) {
         $grp_id = intval($request->getValue('id'));
         $template->setVariable('tpl_userselect', $this->getUserSelection($tree_id, $usr_id, $grp_id, $usr_used));
     }
     // add overview link
     $view = ViewManager::getInstance();
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     $url->setParameter($view->getUrlId(), Reservation::VIEW_USER_GROUP_OVERVIEW);
     $breadcrumb = array('name' => $view->getName(Reservation::VIEW_USER_GROUP_OVERVIEW), 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     // create up & back links and create breadcrumb
     $this->director->theme->handleAdminLinks($template);
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:46,代码来源:ReservationUserGroup.php

示例9: handleTreeOverview

 /**
  * handle tree overview
  */
 private function handleTreeOverview()
 {
     $pagesize = 20;
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_OVERVIEW);
     $page = $this->getPage();
     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);
     $template->setVariable($key);
     $this->pagerUrl->addParameters($key);
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     // add breadcrumb item
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // create urls
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), ViewManager::TREE_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true), false);
     $url_import = clone $url;
     $url_import->setParameter($view->getUrlId(), Gallery::VIEW_IMPORT);
     $template->setVariable('href_import', $url_import->getUrl(true), false);
     $url_resize = clone $url;
     $url_resize->setParameter($view->getUrlId(), Gallery::VIEW_RESIZE);
     $template->setVariable('href_resize', $url_resize->getUrl(true), false);
     $url_conf = clone $url;
     $url_conf->setParameter($view->getUrlId(), Gallery::VIEW_CONFIG);
     $template->setVariable('href_conf', $url_conf->getUrl(true), false);
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), ViewManager::TREE_EDIT);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), ViewManager::TREE_DELETE);
     $url_com = clone $url;
     $url_com->setParameter($view->getUrlId(), Gallery::VIEW_COMMENT_OVERVIEW);
     $list = $this->getList($key, $pagesize, $page, null, clone $url);
     foreach ($list['data'] as &$item) {
         $url_edit->setParameter('id', $item['id']);
         $url_del->setParameter('id', $item['id']);
         $url_com->setParameter('gal_id', $item['id']);
         $item['href_edit'] = $url_edit->getUrl(true);
         $item['href_del'] = $url_del->getUrl(true);
         $item['href_com'] = $url_com->getUrl(true);
         if ($item['thumbnail']) {
             $img = new Image($item['thumbnail'], $this->plugin->getContentPath(true));
             $item['thumbnail'] = array('src' => $this->plugin->getContentPath(false) . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
         }
     }
     $template->setVariable('list', $list, false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:63,代码来源:GalleryOverview.php

示例10: handleTreeOverview

 /**
  * handle tree overview
  */
 private function handleTreeOverview()
 {
     $pagesize = 10;
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $record = $this->plugin->getObject(Form::TYPE_RECORD);
     $recordItem = $this->plugin->getObject(Form::TYPE_RECORD_ITEM);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_OVERVIEW);
     $page = $this->getPage();
     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);
     $template->setVariable($key);
     $this->pagerUrl->addParameters($key);
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     // store updated pager url to record object
     $record->setPagerUrl($this->pagerUrl);
     // handle searchcriteria
     $search = new SearchManager();
     $search->setUrl($this->pagerUrl);
     $search->setExclude($this->pagerKey);
     $search->setParameter('search');
     $search->saveList();
     $searchcriteria = $search->getSearchParameterList();
     $searchcriteria = array_merge($searchcriteria, $key);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // create urls
     $url_conf = clone $url;
     $url_conf->setParameter($view->getUrlId(), Form::VIEW_CONFIG);
     $template->setVariable('href_conf', $url_conf->getUrl(true), false);
     $url_elem = clone $url;
     $url_elem->setParameter($view->getUrlId(), Form::VIEW_ELEMENT_OVERVIEW);
     $template->setVariable('href_elem', $url_elem->getUrl(true), false);
     $url_del_all = clone $url;
     $url_del_all->setParameter($view->getUrlId(), Form::VIEW_RECORD_DEL_ALL);
     $template->setVariable('href_del_all', $url_del_all->getUrl(true), false);
     $url_export = clone $url;
     $url_export->setParameter($view->getUrlId(), Form::VIEW_RECORD_EXPORT);
     $template->setVariable('href_export', $url_export->getUrl(true), false);
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), ViewManager::TREE_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true), false);
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), ViewManager::TREE_EDIT);
     // get columns and create template column list because not every record may have all the columns.
     $recordTemplate = array();
     $columns = $recordItem->getColumns($tree_id, $tag);
     $columns[] = 'timestamp';
     $columns[] = 'host';
     foreach ($columns as $column) {
         $recordTemplate[$column] = '';
     }
     $template->setVariable('columns', $columns);
     $themeVars = $this->director->theme->getFileVars();
     $img_edit = $themeVars['img_edit'];
     $editString = '<a href="%s">' . sprintf('<img class="noborder" src="%s" width="%s" height="%s" alt="edit" title="edit" /></a>', $img_edit['src'], $img_edit['width'], $img_edit['height']);
     $delString = '<input type="checkbox" name="id[]" value="%d" class="noborder" />';
     // retrieve all records within this tree node
     // array[record id] => timestamp
     $searchcriteria = array_merge($searchcriteria, $key);
     $searchcriteria['optin'] = '';
     $recordlist = array();
     $records = $record->getList($searchcriteria, $pagesize, $page);
     foreach ($records['data'] as $item) {
         $recordlist[$item['id']] = $item;
     }
     $template->setVariable('records', $records);
     $recordItemListFinal = array();
     if ($recordlist) {
         // search for all form elements within the specified records
         $elemsearch = array('rcd_id' => array_keys($recordlist));
         $recordItemList = $recordItem->getItems($elemsearch);
         foreach ($recordItemList as $rcd_id => $recordElement) {
             // set values to all the columns
             $element = $recordTemplate;
             foreach ($recordElement as $recordColumn) {
                 // columnames are forced to lowercase, do the same for this result to merge case sensitive versions of columns
                 $element[strtolower($recordColumn['name'])] = $recordColumn['value'];
             }
             $element['timestamp'] = strftime('%c', $recordlist[$rcd_id]['createdate']);
             $element['host'] = $recordlist[$rcd_id]['host'];
             $url_edit->setParameter('rcd_id', $rcd_id);
             $urls = array();
             $urls[] = sprintf($delString, $rcd_id);
             $urls[] = sprintf($editString, $url_edit->getUrl(true));
             array_unshift($element, join('', $urls));
             $recordItemListFinal[] = $element;
//.........这里部分代码省略.........
开发者ID:rverbrugge,项目名称:dif,代码行数:101,代码来源:FormOverview.php

示例11: handleEdit

 /**
  * handle overview
  */
 private function handleEdit($template)
 {
     $request = Request::getInstance();
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $template->setVariable('tree_id', $tree_id, false);
     $template->setVariable('tag', $tag, false);
     // add overview link
     $view = ViewManager::getInstance();
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     $url->setParameter($view->getUrlId(), Reservation::VIEW_BLOCK_PERIOD_OVERVIEW);
     $breadcrumb = array('name' => $view->getName(Reservation::VIEW_BLOCK_PERIOD_OVERVIEW), 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     // create up & back links and create breadcrumb
     $this->director->theme->handleAdminLinks($template);
     $datefields = array();
     $datefields[] = array('dateField' => 'date_start', 'triggerElement' => 'date_start');
     $datefields[] = array('dateField' => 'date_stop', 'triggerElement' => 'date_stop');
     Utils::getDatePicker($this->director->theme, $datefields);
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:26,代码来源:ReservationBlockPeriod.php

示例12: handleEdit

 /**
  * handle overview
  */
 private function handleEdit($template, $grp_used)
 {
     $request = Request::getInstance();
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $template->setVariable('tree_id', $tree_id, false);
     $template->setVariable('tag', $tag, false);
     // add overview link
     $view = ViewManager::getInstance();
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     $url->setParameter($view->getUrlId(), NewsLetter::VIEW_USER_OVERVIEW);
     $breadcrumb = array('name' => $view->getName(NewsLetter::VIEW_USER_OVERVIEW), 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     // create up & back links and create breadcrumb
     $this->director->theme->handleAdminLinks($template);
     // create user groups comboboxes
     $userGroup = new NewsLetterGroup($this->plugin);
     $search_used = $grp_used ? array('id' => $grp_used) : NULL;
     $search_free = $grp_used ? array('no_id' => $grp_used, 'tree_id' => $tree_id, 'tag' => $tag) : array('tree_id' => $tree_id, 'tag' => $tag);
     $group_used = $grp_used ? $userGroup->getList($search_used) : array('data' => '');
     $group_free = $userGroup->getList($search_free);
     $template->setVariable('cbo_grp_used', Utils::getHtmlCombo($group_used['data']), false);
     $template->setVariable('cbo_grp_free', Utils::getHtmlCombo($group_free['data']), false);
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:30,代码来源:NewsLetterUser.php

示例13: handleTreeOverview

 /**
  * handle tree overview
  */
 private function handleTreeOverview()
 {
     $pagesize = 20;
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_OVERVIEW);
     $page = $this->getPage();
     if (!$request->exists('tree_id')) {
         throw new Exception('Node is missing.');
     }
     if (!$request->exists('tag')) {
         throw new Exception('Tag is missing.');
     }
     $tree_id = intval($request->getValue('tree_id'));
     $tag = $request->getValue('tag');
     $key = array('tree_id' => $tree_id, 'tag' => $tag);
     $this->pagerUrl->addParameters($key);
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     // handle searchcriteria
     $search = new SearchManager();
     $search->setUrl($this->pagerUrl);
     $search->setExclude($this->pagerKey);
     $search->setParameter('search');
     $search->saveList();
     $searchcriteria = $search->getSearchParameterList();
     $searchcriteria = array_merge($searchcriteria, $key);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->clearParameter('nl_id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // create urls
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), ViewManager::TREE_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true), false);
     $url_conf = clone $url;
     $url_conf->setParameter($view->getUrlId(), NewsLetter::VIEW_CONFIG);
     $template->setVariable('href_conf', $url_conf->getUrl(true), false);
     $url_user = clone $url;
     $url_user->setParameter($view->getUrlId(), NewsLetter::VIEW_USER_OVERVIEW);
     $template->setVariable('href_user', $url_user->getUrl(true), false);
     $url_group = clone $url;
     $url_group->setParameter($view->getUrlId(), NewsLetter::VIEW_GROUP_OVERVIEW);
     $template->setVariable('href_group', $url_group->getUrl(true), false);
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), ViewManager::TREE_EDIT);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), ViewManager::TREE_DELETE);
     $url_att = clone $url;
     $url_att->setParameter($view->getUrlId(), NewsLetter::VIEW_FILE_OVERVIEW);
     $url_preview = clone $url;
     $url_preview->setParameter($view->getUrlId(), NewsLetter::VIEW_PREVIEW);
     $url_send = clone $url;
     $url_send->setParameter($view->getUrlId(), NewsLetter::VIEW_SEND);
     $url_plugin = clone $url;
     $url_plugin->setParameter($view->getUrlId(), NewsLetter::VIEW_PLUGIN_OVERVIEW);
     $list = $this->getList($searchcriteria, $pagesize, $page);
     foreach ($list['data'] as &$item) {
         $url_edit->setParameter('id', $item['id']);
         $url_del->setParameter('id', $item['id']);
         $url_att->setParameter('nl_id', $item['id']);
         $url_plugin->setParameter('nl_id', $item['id']);
         $url_preview->setParameter('nl_id', $item['id']);
         $url_send->setParameter('nl_id', $item['id']);
         $item['href_edit'] = $url_edit->getUrl(true);
         $item['href_del'] = $url_del->getUrl(true);
         $item['href_att'] = $url_att->getUrl(true);
         $item['href_plugin'] = $url_plugin->getUrl(true);
         $item['href_preview'] = $url_preview->getUrl(true);
         $item['href_send'] = $url_send->getUrl(true);
         if ($item['thumbnail']) {
             $img = new Image($item['thumbnail'], $this->plugin->getContentPath(true));
             $item['thumbnail'] = array('src' => $this->plugin->getContentPath(false) . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
         }
     }
     $template->setVariable('list', $list, false);
     $template->setVariable('searchparam', $search->getMandatoryParameterList(), false);
     $template->setVariable('searchcriteria', $searchcriteria, false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:84,代码来源:NewsLetterOverview.php

示例14: handleTreeOverviewGet

 /**
  * handle tree overview
  */
 private function handleTreeOverviewGet($retrieveFields = true)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     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);
     // add breadcrumb item
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // create urls
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), Form::VIEW_ELEMENT_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true));
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), Form::VIEW_ELEMENT_EDIT);
     $url_mv_prev = clone $url;
     $url_mv_prev->setParameter($view->getUrlId(), Form::VIEW_MV_PREC);
     $url_mv_next = clone $url;
     $url_mv_next->setParameter($view->getUrlId(), Form::VIEW_MV_FOL);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), Form::VIEW_ELEMENT_DELETE);
     $list = $this->getList($key, 0, 1, SqlParser::ORDER_ASC);
     $counter = 0;
     $maxcount = $list['totalItems'];
     foreach ($list['data'] as &$item) {
         $counter++;
         $url_edit->setParameter('id', $item['id']);
         $url_del->setParameter('id', $item['id']);
         $url_mv_prev->setParameter('id', $item['id']);
         $url_mv_next->setParameter('id', $item['id']);
         $item['type_id'] = $this->getTypeId($item['id']);
         $item['href_edit'] = $url_edit->getUrl(true);
         $item['href_del'] = $url_del->getUrl(true);
         if ($counter > 1) {
             $item['href_mv_prev'] = $url_mv_prev->getUrl(true);
         }
         if ($counter < $maxcount) {
             $item['href_mv_next'] = $url_mv_next->getUrl(true);
         }
     }
     $template->setVariable('list', $list);
     //$this->handleTreeSettings($template);
     $this->director->theme->handleAdminLinks($template);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:58,代码来源:FormElement.php

示例15: handleElementOverview

 /**
  * handle element overview
  */
 private function handleElementOverview($template)
 {
     $reference = $this->getObject(self::TYPE_ELEMENT);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_OVERVIEW);
     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);
     // add breadcrumb item
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('tag', $tag);
     // create urls
     $url_new = clone $url;
     $url_new->setParameter($view->getUrlId(), ViewManager::TREE_NEW);
     $template->setVariable('href_new', $url_new->getUrl(true));
     $url_edit = clone $url;
     $url_edit->setParameter($view->getUrlId(), ViewManager::TREE_EDIT);
     $url_del = clone $url;
     $url_del->setParameter($view->getUrlId(), ViewManager::TREE_DELETE);
     $list = $reference->getList($key);
     foreach ($list['data'] as &$item) {
         $url_edit->setParameter('id', $item['id']);
         $url_del->setParameter('id', $item['id']);
         $item['type_id'] = $reference->getTypeId($item['id']);
         $item['href_edit'] = $url_edit->getUrl(true);
         $item['href_del'] = $url_del->getUrl(true);
     }
     $template->setVariable('list', $list);
     return $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:42,代码来源:Form.php


注:本文中的Url::clearParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。