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


PHP FrontendNavigation::getURL方法代码示例

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


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

示例1: execute

 /**
  * Execute the extra.
  *
  * @return	void
  */
 public function execute()
 {
     // get reset key
     $key = $this->URL->getParameter(0);
     // do we have an reset key?
     if (isset($key)) {
         // load parent
         parent::execute();
         // load template
         $this->loadTemplate();
         // get profile id
         $profileId = FrontendProfilesModel::getIdBySetting('forgot_password_key', $key);
         // have id?
         if ($profileId !== 0) {
             // load
             $this->loadForm();
             // validate
             $this->validateForm();
         } elseif ($this->URL->getParameter('saved') != 'true') {
             $this->redirect(FrontendNavigation::getURL(404));
         }
         // parse
         $this->parse();
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:netconstructor,项目名称:forkcms,代码行数:32,代码来源:reset_password.php

示例2: execute

 /**
  * Execute the extra.
  */
 public function execute()
 {
     // get activation key
     $key = $this->URL->getParameter(0);
     // load template
     $this->loadTemplate();
     // do we have an activation key?
     if (isset($key)) {
         // get profile id
         $profileId = FrontendProfilesModel::getIdBySetting('activation_key', $key);
         // have id?
         if ($profileId != null) {
             // update status
             FrontendProfilesModel::update($profileId, array('status' => 'active'));
             // delete activation key
             FrontendProfilesModel::deleteSetting($profileId, 'activation_key');
             // login profile
             FrontendProfilesAuthentication::login($profileId);
             // trigger event
             FrontendModel::triggerEvent('profiles', 'after_activate', array('id' => $profileId));
             // show success message
             $this->tpl->assign('activationSuccess', true);
         } else {
             $this->redirect(FrontendNavigation::getURL(404));
         }
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:32,代码来源:activate.php

示例3: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // validate incoming parameters
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get by URL
     $this->record = FrontendFaqModel::get($this->URL->getParameter(1));
     // anything found?
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // overwrite URLs
     $this->record['category_full_url'] = FrontendNavigation::getURLForBlock('faq', 'category') . '/' . $this->record['category_url'];
     $this->record['full_url'] = FrontendNavigation::getURLForBlock('faq', 'detail') . '/' . $this->record['url'];
     // get tags
     $this->record['tags'] = FrontendTagsModel::getForItem('faq', $this->record['id']);
     // get settings
     $this->settings = FrontendModel::getModuleSettings('faq');
     // reset allow comments
     if (!$this->settings['allow_feedback']) {
         $this->record['allow_feedback'] = false;
     }
     // ge status
     $this->status = $this->URL->getParameter(2);
     if ($this->status == FL::getAction('Success')) {
         $this->status = 'success';
     }
     if ($this->status == FL::getAction('Spam')) {
         $this->status = 'spam';
     }
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:35,代码来源:detail.php

示例4: getData

 /**
  * Load the data, don't forget to validate the incoming data
  *
  * @return	void
  */
 private function getData()
 {
     // get categories
     $categories = FrontendBlogModel::getAllCategories();
     $possibleCategories = array();
     foreach ($categories as $category) {
         $possibleCategories[$category['url']] = $category['id'];
     }
     // requested category
     $requestedCategory = SpoonFilter::getValue($this->URL->getParameter(1, 'string'), array_keys($possibleCategories), 'false');
     // requested page
     $requestedPage = $this->URL->getParameter('page', 'int', 1);
     // validate category
     if ($requestedCategory == 'false') {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // set category
     $this->category = $categories[$possibleCategories[$requestedCategory]];
     // set URL and limit
     $this->pagination['url'] = FrontendNavigation::getURLForBlock('blog', 'category') . '/' . $requestedCategory;
     $this->pagination['limit'] = FrontendModel::getModuleSetting('blog', 'overview_num_items', 10);
     // populate count fields in pagination
     $this->pagination['num_items'] = FrontendBlogModel::getAllForCategoryCount($requestedCategory);
     $this->pagination['num_pages'] = (int) ceil($this->pagination['num_items'] / $this->pagination['limit']);
     // redirect if the request page doesn't exists
     if ($requestedPage > $this->pagination['num_pages'] || $requestedPage < 1) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // populate calculated fields in pagination
     $this->pagination['requested_page'] = $requestedPage;
     $this->pagination['offset'] = $this->pagination['requested_page'] * $this->pagination['limit'] - $this->pagination['limit'];
     // get articles
     $this->items = FrontendBlogModel::getAllForCategory($requestedCategory, $this->pagination['limit'], $this->pagination['offset']);
 }
开发者ID:netconstructor,项目名称:forkcms,代码行数:39,代码来源:category.php

示例5: getData

    /**
     * Load the data, don't forget to validate the incoming data
     */
    private function getData()
    {
        // validate incoming parameters
        if ($this->URL->getParameter(1) === null) {
            $this->redirect(FrontendNavigation::getURL(404));
        }
        // fetch record
        $this->record = FrontendTagsModel::get($this->URL->getParameter(1));
        // validate record
        if (empty($this->record)) {
            $this->redirect(FrontendNavigation::getURL(404));
        }
        // fetch modules
        $this->modules = FrontendTagsModel::getModulesForTag($this->record['id']);
        // loop modules
        foreach ($this->modules as $module) {
            // set module class
            $class = 'Frontend' . SpoonFilter::toCamelCase($module) . 'Model';
            // get the ids of the items linked to the tag
            $otherIds = (array) FrontendModel::getDB()->getColumn('SELECT other_id
				 FROM modules_tags
				 WHERE module = ? AND tag_id = ?', array($module, $this->record['id']));
            // set module class
            $class = 'Frontend' . SpoonFilter::toCamelCase($module) . 'Model';
            // get the items that are linked to the tags
            $items = (array) FrontendTagsModel::callFromInterface($module, $class, 'getForTags', $otherIds);
            // add into results array
            if (!empty($items)) {
                $this->results[] = array('name' => $module, 'label' => FL::lbl(SpoonFilter::ucfirst($module)), 'items' => $items);
            }
        }
    }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:35,代码来源:detail.php

示例6: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // validate incoming parameters
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // load revision
     if ($this->URL->getParameter('revision', 'int') != 0) {
         // get data
         $this->record = FrontendBlogModel::getRevision($this->URL->getParameter(1), $this->URL->getParameter('revision', 'int'));
         // add no-index, so the draft won't get accidentally indexed
         $this->header->addMetaData(array('name' => 'robots', 'content' => 'noindex, nofollow'), true);
     } else {
         $this->record = FrontendBlogModel::get($this->URL->getParameter(1));
     }
     // anything found?
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get comments
     $this->comments = FrontendBlogModel::getComments($this->record['id']);
     // get tags
     $this->record['tags'] = FrontendTagsModel::getForItem('blog', $this->record['id']);
     // get settings
     $this->settings = FrontendModel::getModuleSettings('blog');
     // overwrite URLs
     $this->record['category_full_url'] = FrontendNavigation::getURLForBlock('blog', 'category') . '/' . $this->record['category_url'];
     $this->record['full_url'] = FrontendNavigation::getURLForBlock('blog', 'detail') . '/' . $this->record['url'];
     $this->record['allow_comments'] = $this->record['allow_comments'] == 'Y';
     $this->record['comments_count'] = count($this->comments);
     // reset allow comments
     if (!$this->settings['allow_comments']) {
         $this->record['allow_comments'] = false;
     }
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:38,代码来源:detail.php

示例7: loadData

 /**
  * Load the data
  */
 protected function loadData()
 {
     //--Check the params
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     //--Get record
     $this->record = FrontendGalleryModel::getAlbum($this->URL->getParameter(1));
     //--Redirect if empty
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:Comsa,项目名称:modules,代码行数:16,代码来源:Detail.php

示例8: execute

 /**
  * Execute the extra
  */
 public function execute()
 {
     // profile not logged in
     if (!FrontendProfilesAuthentication::isLoggedIn()) {
         parent::execute();
         $this->loadTemplate();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:16,代码来源:resend_activation.php

示例9: getData

 /**
  * Load the data, don't forget to validate the incoming data
  *
  * @return	void
  */
 private function getData()
 {
     // store the ID
     $this->id = $this->URL->getParameter(1);
     // store the type
     $this->type = SpoonFilter::getGetValue('type', array('html', 'plain'), 'html');
     // is this CM asking the info?
     $this->forCM = SpoonFilter::getGetValue('cm', array(0, 1), 0, 'bool');
     // fetch the mailing data
     $this->record = FrontendMailmotorModel::get($this->id);
     // anything found?
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:netconstructor,项目名称:forkcms,代码行数:20,代码来源:detail.php

示例10: execute

 /**
  * Execute the extra.
  *
  * @return	void
  */
 public function execute()
 {
     // no url parameter
     if (FrontendProfilesAuthentication::isLoggedIn()) {
         // call the parent
         parent::execute();
         /*
          * You could use this as some kind of dashboard where you could show an activity stream, some statistics, ...
          */
         // load template
         $this->loadTemplate();
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:netconstructor,项目名称:forkcms,代码行数:20,代码来源:index.php

示例11: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // validate incoming parameters
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get record
     $this->record = FrontendBlogModel::get($this->URL->getParameter(1));
     // anything found?
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get articles
     $this->items = FrontendBlogModel::getComments($this->record['id']);
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:18,代码来源:article_comments_rss.php

示例12: getData

 /**
  * Load the data, don't forget to validate the incoming data
  */
 private function getData()
 {
     // validate incoming parameters
     if ($this->URL->getParameter(1) === null) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     // get by URL
     $this->record = FrontendFaqModel::getCategory($this->URL->getParameter(1));
     // anything found?
     if (empty($this->record)) {
         $this->redirect(FrontendNavigation::getURL(404));
     }
     $this->record['full_url'] = FrontendNavigation::getURLForBlock('faq', 'category') . '/' . $this->record['url'];
     $this->questions = FrontendFaqModel::getAllForCategory($this->record['id']);
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:18,代码来源:category.php

示例13: execute

 /**
  * Execute the extra.
  */
 public function execute()
 {
     // only logged in profiles can seer their dashboard
     if (FrontendProfilesAuthentication::isLoggedIn()) {
         // call the parent
         parent::execute();
         /*
          * You could use this as some kind of dashboard where you can show an activity
          * stream, some statistics, ...
          */
         $this->loadTemplate();
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:18,代码来源:index.php

示例14: __construct

 /**
  * Default constructor
  *
  * @return	void
  */
 public function __construct()
 {
     // call parent
     parent::__construct();
     // add into the reference
     Spoon::set('breadcrumb', $this);
     // get more information for the homepage
     $homeInfo = FrontendNavigation::getPageInfo(1);
     // add homepage as first item (with correct element)
     $this->addElement($homeInfo['navigation_title'], FrontendNavigation::getURL(1));
     // get other pages
     $pages = $this->URL->getPages();
     // init vars
     $items = array();
     $errorURL = FrontendNavigation::getUrl(404);
     // loop pages
     while (!empty($pages)) {
         // init vars
         $URL = implode('/', $pages);
         $menuId = FrontendNavigation::getPageId($URL);
         $pageInfo = FrontendNavigation::getPageInfo($menuId);
         // do we know something about the page
         if ($pageInfo !== false && isset($pageInfo['navigation_title'])) {
             // only add pages that aren't direct actions
             if ($pageInfo['tree_type'] != 'direct_action') {
                 // get URL
                 $pageURL = FrontendNavigation::getUrl($menuId);
                 // if this is the error-page, so we won't show an URL.
                 if ($pageURL == $errorURL) {
                     $pageURL = null;
                 }
                 // add to the items
                 $items[] = array('title' => $pageInfo['navigation_title'], 'url' => $pageURL);
             }
         }
         // remove element
         array_pop($pages);
     }
     // reverse so everything is in place
     krsort($items);
     // loop and add elements
     foreach ($items as $row) {
         $this->addElement($row['title'], $row['url']);
     }
 }
开发者ID:netconstructor,项目名称:forkcms,代码行数:50,代码来源:breadcrumb.php

示例15: execute

 /**
  * Execute the extra.
  *
  * @return	void
  */
 public function execute()
 {
     // profile logged in
     if (FrontendProfilesAuthentication::isLoggedIn()) {
         // load parent
         parent::execute();
         // get data
         $this->getData();
         // load template
         $this->loadTemplate();
         // load
         $this->loadForm();
         // validate
         $this->validateForm();
         // parse
         $this->parse();
     } else {
         $this->redirect(FrontendNavigation::getURL(404));
     }
 }
开发者ID:netconstructor,项目名称:forkcms,代码行数:25,代码来源:profile_password.php


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