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


PHP Url::setParameter方法代码示例

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


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

示例1: getList

 /**
  * retrieves a list from a database
  * @param array $searchcriteria supplied criteria
  * @param integer $pagesize size of result
  * @param integer $page offset
  * @param integer $order type of order
  * @return array
  */
 public function getList($searchcriteria = NULL, $pagesize = 0, $page = 1, $order = NULL)
 {
     $sqlParser = clone $this->sqlParser;
     $sqlParser->parseCriteria($searchcriteria);
     $this->parseCriteria($sqlParser, $searchcriteria);
     $sqlParser->setOrderby($this->getOrder($order));
     $query = $sqlParser->getSql(SqlParser::SEL_LIST);
     //if($sqlParser->getTable() == 'siteplugin') echo $query."<br />\n";
     //if($sqlParser->getTable() == 'users') Utils::debug($query);
     $db = $this->getDb();
     $this->pagerUrl->setParameter($this->getPagerKey(), '%d', false);
     //Pager replaces "%d" with the page number
     $this->pagerOptions['perPage'] = $pagesize;
     $this->pagerOptions['currentPage'] = $page;
     $this->pagerOptions['fileName'] = $this->pagerUrl->getUrl(false);
     $res = Pager_Wrapper_MDB2($db, $query, $this->pagerOptions, $pagesize == 0);
     if ($db->isError($res)) {
         throw new Exception($res->getDebugInfo());
     }
     // do postprocessing
     foreach ($res['data'] as &$item) {
         if (!$item) {
             continue;
         }
         $item['formatName'] = $this->formatName($item);
         $item = $this->handlePostGetList($item);
     }
     return $res;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:37,代码来源:DbConnector.php

示例2: 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

示例3: addComment

 /**
  * handle add
  */
 public function addComment($values)
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $values['active'] = 1;
     try {
         $id = $this->insert($values);
         $calendar = $this->plugin->getObject(Calendar::TYPE_DEFAULT);
         $calendarDetail = $calendar->getDetail(array('id' => $values['cal_id']));
         $url = new Url();
         $url->setPath($this->director->tree->getPath($calendarDetail['tree_id']));
         $url->setParameter('id', $calendarDetail['id']);
         $url->setParameter($view->getUrlId(), Calendar::VIEW_DETAIL);
         // notify insert
         $ip = $request->getValue('REMOTE_ADDR', Request::SERVER);
         $template = new TemplateEngine($this->getPath() . "templates/calendarcommentemail.tpl");
         $template->setVariable($values);
         $template->setVariable('calendarName', $calendarDetail['name']);
         $template->setVariable('href_detail', $url->getUrl());
         $template->setVariable('siteTitle', $this->director->tree->getTreeName());
         $template->setVariable('domain', $request->getDomain());
         $template->setVariable('protocol', $request->getProtocol());
         $template->setVariable('ip', $ip);
         $template->setVariable('host', gethostbyaddr($ip));
         $template->setVariable('client', $request->getValue('HTTP_USER_AGENT', Request::SERVER));
         $this->director->systemUser->notify($calendarDetail['tree_id'], 'Comment added at ' . $request->getDomain(), $template->fetch());
     } catch (Exception $e) {
         $template = new TemplateEngine();
         $template->setVariable('commentError', $e->getMessage(), false);
         $template->setVariable('cmtValues', $values, false);
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:35,代码来源:CalendarComment.php

示例4: 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

示例5: handleAdminSubLinks

 /**
  * 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);
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:30,代码来源:Theme.php

示例6: handleTreeSettings

 private function handleTreeSettings($template)
 {
     $view = ViewManager::getInstance();
     $request = Request::getInstance();
     if (!$request->exists('tree_id')) {
         throw new Exception('Node ontbreekt.');
     }
     if (!$request->exists('nl_id')) {
         throw new Exception('Newsletter is missing.');
     }
     if (!$request->exists('tag')) {
         throw new Exception('Tag ontbreekt.');
     }
     $tree_id = intval($request->getValue('tree_id'));
     $nl_id = intval($request->getValue('nl_id'));
     $tag = $request->getValue('tag');
     $template->setVariable('tree_id', $tree_id, false);
     $template->setVariable('tag', $tag, false);
     // create href back url
     $url = new Url(true);
     $url->setParameter('tree_id', $tree_id);
     $url->setParameter('nl_id', $nl_id);
     $url->setParameter('id', $nl_id);
     $url->setParameter('tag', $tag);
     $url->setParameter($view->getUrlId(), NewsLetter::VIEW_FILE_OVERVIEW);
     $template->setVariable('href_back', $url->getUrl(true), false);
     // add breadcrumb item
     $breadcrumb = array('name' => $view->getName(NewsLetter::VIEW_FILE_OVERVIEW), 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     $this->director->theme->handleAdminLinks($template);
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:31,代码来源:NewsLetterAttachment.php

示例7: 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' => News::TYPE_ARCHIVE));
     if (!$taglist) {
         return;
     }
     $taginfo = current($taglist);
     // process attachments
     $attachment = $this->getAttachment();
     $attachment->handleHttpGetRequest();
     // clear subtitle
     $view->setName('');
     if (!$request->exists('id')) {
         continue;
     }
     $id = intval($request->getValue('id'));
     $key = array('id' => $id, 'active' => true);
     $overview = $this->getNewsOverview();
     if (!$overview->exists($key)) {
         throw new HttpException('404');
     }
     $detail = $overview->getDetail($key);
     // check if tree node of news item is accessable
     $tree = $this->director->tree;
     if (!$tree->exists($detail['tree_id'])) {
         throw new HttpException('404');
     }
     $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);
     $template->setVariable('news', $detail, 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);
     $this->template[$taginfo['tag']] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:53,代码来源:NewsArchive.php

示例8: renderSiteGroup

 private function renderSiteGroup()
 {
     $template = new TemplateEngine($this->getPath() . "templates/sitegroup.tpl");
     $siteGroup = $this->getSiteGroup();
     $id = $siteGroup->getCurrentId();
     $url = new Url();
     $url->useCurrent(false);
     $grouplist = $siteGroup->getList();
     //if($grouplist['totalItems'] < 2) return;
     foreach ($grouplist['data'] as &$item) {
         $url->setParameter(SystemSiteGroup::CURRENT_ID_KEY, $item['id']);
         $item['href_detail'] = $url->getUrl(true);
         $item['selected'] = $item['id'] == $id;
     }
     $template->setVariable('sitegroup', $grouplist, false);
     // add link to sitegroup to add / modify / delete websites
     $admin = $this->director->adminManager;
     $admintree = $admin->tree;
     $sitegroupPath = $admintree->getPath($admintree->getIdFromClassname('SiteGroup'));
     $template->setVariable('href_sitegroup', $sitegroupPath, false);
     return $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:22,代码来源:Site.php

示例9: handleImportGet

 /**
  * handle import
  */
 private function handleImportGet()
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $grp_used = $request->getValue('grp_used');
     $this->handleEdit($template, $grp_used);
     $template->setVariable('id', '', false);
     $url_import_template = new Url(true);
     $url_import_template->setParameter($view->getUrlId(), self::VIEW_IMPORT_TEMPL);
     $template->setVariable('href_import_template', $url_import_template->getUrl(true), false);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:16,代码来源:User.php

示例10: 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

示例11: handleAdminDeleteGet

 /**
  * 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;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:19,代码来源:SiteGroup.php

示例12: 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

示例13: 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

示例14: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $taglist = $this->getTagList();
     if (!$taglist) {
         return;
     }
     $tree = $this->director->tree;
     foreach ($taglist as $item) {
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         $template->setCacheable(true);
         $template->setPostfix($item['tag']);
         $key = array('tree_id' => $item['tree_id'], 'tag' => $item['tag']);
         // check if template is in cache
         if (!$template->isCached()) {
             $siteGroup = $this->getSiteGroup();
             $id = $siteGroup->getCurrentId();
             $detail = $this->exists($key) ? $this->getDetail($key) : $this->getFields(SqlParser::MOD_INSERT);
             $template->setVariable('detail', $detail);
             $url = new Url();
             $url->setPath('/');
             $grouplist = $siteGroup->getList(array('active' => true));
             if ($grouplist['totalItems'] < 2) {
                 continue;
             }
             foreach ($grouplist['data'] as &$list) {
                 $url->setParameter(SystemSiteGroup::CURRENT_ID_KEY, $list['id']);
                 $list['path'] = $url->getUrl(true);
                 $list['selected'] = $list['id'] == $id;
                 $list['img'] = $this->getImage($list['language']);
             }
             $template->setVariable('sitegroup', $grouplist, false);
             $template->setVariable('sitegroupId', $id);
         }
         $this->template[$item['tag']] = $template;
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:39,代码来源:SiteSelect.php

示例15: handlePost

 private function handlePost()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     try {
         $autentication = Authentication::getInstance();
         $usermail = $request->getValue('email');
         if (!$usermail) {
             throw new Exception("Email adres ontbreekt.");
         }
         if (!$request->exists('tag')) {
             throw new Exception('Tag ontbreekt.');
         }
         $tree = $this->director->tree;
         $tag = $request->getValue('tag');
         $tree_id = $tree->getCurrentId();
         $key = array('tree_id' => $tree_id, 'tag' => $tag);
         $detail = $this->getDetail($key);
         if (!$detail) {
             $this->log->info("Request login information for unknown user at " . $request->getValue('REMOTE_ADDR', Request::SERVER));
             throw new Exception("Error creating request");
         }
         // get userinfo
         $systemUser = new SystemUser();
         $users = $systemUser->getList(array('email' => $usermail));
         foreach ($users['data'] as $user) {
             $detail = array_merge($detail, $user);
             $loginKey = md5(time() . $user['username']);
             $requestValues = array('request_key' => $loginKey, 'usr_id' => $user['id']);
             // register request
             $loginRequest = new LoginRequest();
             $loginRequest->insert($requestValues);
             $url = new Url(true);
             $url->setParameter($view->getUrlId(), self::VIEW_ACTIVATE);
             $url->setParameter('key', $loginKey);
             // mail userinfo (only if user is present)
             if ($user) {
                 $this->sendMail($user['email'], $this->director->getConfig()->email_address, $detail['subject'], $detail, $request->getProtocol() . $request->getDomain() . $url->getUrl());
             }
         }
         $referer = $detail['ref_tree_id'] ? $tree->getPath($detail['ref_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();
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:49,代码来源:LoginMailer.php


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