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


PHP Pages类代码示例

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


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

示例1: getlinkAction

 public function getlinkAction()
 {
     // Parameter auslesen
     $link_to_page_id = Request::postParam('linkToPageId');
     $link_to_language_id = Request::postParam('linkToLanguageId');
     $link_to_anchor_name = Request::postParam('linkToAnchorName');
     // Parameter überprüfen
     if (!is_numeric($link_to_page_id) || $link_to_language_id == '') {
         $this->error(self::RESULT_ERROR_BAD_REQUEST);
         return;
     }
     $pages = new Pages();
     // Die absolute URL auslesen
     $absolute_url = $pages->getPageUrl($link_to_page_id, $link_to_language_id);
     // eine zum Stammverzeichnis des CMS relative URL daraus machen
     $base_url = Config::get()->baseUrl;
     $relative_url = UTF8String::substr($absolute_url, UTF8String::strlen($base_url), UTF8String::strlen($absolute_url));
     if ($link_to_anchor_name != '') {
         if ($relative_url != '') {
             $relative_url = rtrim($relative_url, '/') . '/';
         }
         $relative_url .= '#' . $link_to_anchor_name;
     }
     // Zurückgeben
     $this->success($relative_url);
 }
开发者ID:pixelproduction,项目名称:PixelManagerCMS,代码行数:26,代码来源:Linkselector.php

示例2: defaultAction

 public function defaultAction()
 {
     if (Translate::getId() != '') {
         $config = Config::getArray();
         $languages = $config['backendLanguages']['list'];
         $language_id = Translate::getId();
         $strings = array();
         if (is_array($languages[$language_id]['translationClientside'])) {
             if (count($languages[$language_id]['translationClientside']) > 0) {
                 foreach ($languages[$language_id]['translationClientside'] as $translation_file) {
                     $temp = (include $translation_file);
                     $strings = array_merge($strings, $temp);
                 }
             }
         } else {
             if ($languages[$language_id]['translationClientside'] != '') {
                 $strings = (include $languages[$language_id]['translationClientside']);
             }
         }
         $this->view->assign('backendTranslation', $strings);
     } else {
         $this->view->assign('backendTranslation', array());
     }
     $useGlobalElementsPage = false;
     $pages = new Pages();
     if ($pages->isGlobalElementsPageTemplateAvailable()) {
         if ($pages->isGlobalElementsPageAvailable()) {
             $useGlobalElementsPage = true;
         }
     }
     $this->view->assign('useGlobalElementsPage', $useGlobalElementsPage);
     $this->view->assign('globalElementsPageId', $pages->getGlobalElementsPageId());
 }
开发者ID:pixelproduction,项目名称:PixelManagerCMS,代码行数:33,代码来源:Main.php

示例3: indexAction

 public function indexAction()
 {
     // setup captcha
     if (!$this->view->captcha) {
         $this->view->setVar('captcha', new Captcha\Captcha($this->getDI()->get('config')->recaptcha));
     }
     // get page data
     $pagesTable = new Pages();
     $this->view->setVar(self::PAGE_NAME, $pagesTable->getPageData(self::PAGE_NAME));
     // prepare form
     if (!$this->view->form) {
         $this->view->setVar('form', new \ContactForm\ContactForm());
     }
     if ($this->getDI()->getRequest()->isPost()) {
         $this->view->form = new \ContactForm\ContactForm();
         $newContact = new Contact();
         if ($this->view->form->isValid($this->getDI()->getRequest()->getPost(), $newContact) && $this->view->getVar('captcha')->checkAnswer($this->getDI()->getRequest())) {
             // create new feedback
             $newContact->create();
             // send notification to webmaster
             $newContact->sendFeedbackToAdmin($this->getDI()->get('config'));
             return $this->_forwardContactIndex();
         } else {
             // output error message
             $this->view->setVar('errors', $this->view->form->getMessages());
         }
     }
 }
开发者ID:threestarsgenius,项目名称:homework,代码行数:28,代码来源:ContactController.php

示例4: initPage

 protected function initPage()
 {
     // If no page id, we have a problem
     $page_id = $this->getRequest()->getParam("pid");
     // If the page does not exist, we have a problem
     $pages = new Pages();
     if ($page = $pages->getPage($page_id)) {
         $this->_page = $page;
     }
     // get the page properties
     if ($page) {
         $this->_page_properties = new PagesProperties(array(PagesProperties::KEY => $page['id']));
         $this->view->page_id = $this->_page['id'];
         $this->view->page_title = $this->_page['title'];
     } else {
         $this->view->page_id = false;
     }
     // Get the tab for further use
     if ($tab = (int) $this->getRequest()->getParam("tab")) {
         $this->view->tab = $tab;
     }
     // Prepare the view
     $this->_helper->layout->setLayoutPath($this->_root . '/application/public/views/layouts/')->setlayout('default');
     $this->view->page_class = $this->_prefix;
 }
开发者ID:kreativmind,项目名称:storytlr,代码行数:25,代码来源:BaseController.php

示例5: dellPage

 public function dellPage($pageId)
 {
     //удалить из таблиц router_contents router_pages
     $pageModel = new Pages($this->dbObject);
     $pageModel->delContent($pageId);
     $pageModel->delPage($pageId);
 }
开发者ID:kittiwake,项目名称:ownfrw,代码行数:7,代码来源:RouterController.php

示例6: smarty_function_pageurl

function smarty_function_pageurl($params, Smarty_Internal_Template $template)
{
    $output = '';
    if (isset($params['page'])) {
        if (isset($params['language'])) {
            $language_id = $params['language'];
        } else {
            $language_id = $template->getTemplateVars('languageId');
            if ($language_id === null) {
                $language_id = Config::get()->languages->standard;
            }
        }
        $mixed_id = $params['page'];
        $page_id = false;
        $pages = new Pages();
        if (is_int($mixed_id)) {
            $page_id = $mixed_id;
        } else {
            if (is_numeric($mixed_id)) {
                $page_id = (int) $mixed_id;
            } else {
                if (is_string($mixed_id)) {
                    $page_id = $pages->getPageIdByUniqueId($mixed_id);
                }
            }
        }
        if ($page_id !== false) {
            $output = $pages->getPageUrl($page_id, $language_id);
        }
    }
    return $output;
}
开发者ID:pixelproduction,项目名称:PixelManagerCMS,代码行数:32,代码来源:function.pageurl.php

示例7: updatetestimonialsAction

 public function updatetestimonialsAction()
 {
     global $mySession;
     $db = new Db();
     echo $testimonialsId;
     $testimonialsId = $this->getRequest()->getParam('testimonialsId');
     $this->view->testimonialsId = $testimonialsId;
     $this->view->pageHeading = "Edit testimonials";
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $myform = new Form_Testimonials();
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             $myObj = new Pages();
             $Result = $myObj->UpdateTestimonials($dataForm, $testimonialsId);
             if ($Result == 1) {
                 $mySession->errorMsg = "testimonials updated successfully.";
                 $this->_redirect('testimonials/index');
             } else {
                 $mySession->errorMsg = "testimonials name you entered already exists.";
                 $this->view->myform = $myform;
                 $this->render('edittestimonials');
             }
         } else {
             $this->view->myform = $myform;
             $this->render('edittestimonials');
         }
     } else {
         $this->_redirect('testimonials/edittestimonials/testimonialsId/' . $testimonialsId);
     }
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:31,代码来源:TestimonialsController.php

示例8: error

 private function error()
 {
     $path = CONTROLLERS . 'pages_controller.php';
     require_once $path;
     $page = new Pages();
     $params = array('404');
     return $page->load($params, true);
 }
开发者ID:8bitorange,项目名称:Small-MVC,代码行数:8,代码来源:Router.php

示例9: indexAction

 public function indexAction()
 {
     // enable specific js and css content for only this page
     $this->view->setVar(self::PAGE_NAME, true);
     // get page data from db
     $pagesTable = new Pages();
     $this->view->setVar(self::PAGE_NAME, $pagesTable->getPageData(self::PAGE_NAME));
 }
开发者ID:threestarsgenius,项目名称:homework,代码行数:8,代码来源:GalleryController.php

示例10: szczegolyAction

 function szczegolyAction()
 {
     $oRequest = $this->getRequest();
     $iPages = $oRequest->getParam('id');
     $oPages = new Pages();
     $this->view->oPages = $oPages->find($iPages)->current();
     $strony = new Strony();
     $this->view->strony = $strony->fetchAll();
 }
开发者ID:stasiu38,项目名称:cms,代码行数:9,代码来源:IndexController.php

示例11: defaultAction

 public function defaultAction()
 {
     if (!Auth::isAdmin()) {
         $this->accessDenied();
         return;
     }
     $pages = new Pages();
     $this->view->assign('pagetree', $pages->getChildren());
     $this->view->assign('settings', Settings::getAll());
 }
开发者ID:pixelproduction,项目名称:PixelManagerCMS,代码行数:10,代码来源:Settings.php

示例12: indexAction

 public function indexAction()
 {
     $tab = (int) $this->getRequest()->getParam("tab");
     $user = Zend_Registry::get('user');
     $pages = new Pages(array(Pages::USER => $user->id));
     $tabs = $pages->getPages();
     if (count($tabs) > 0 && $tab < count($tabs)) {
         $page = $tabs[$tab];
         $this->_forward('index', $page['prefix'], 'pages', array('pid' => $page['id']));
     } else {
         $this->_forward('index', 'nopage', 'pages');
     }
 }
开发者ID:kreativmind,项目名称:storytlr,代码行数:13,代码来源:HomeController.php

示例13: pages

 protected function pages()
 {
     $kirby = $this->kirbyInstance();
     $site = $this->siteInstance($kirby);
     $a = $site->find('a');
     $b = $site->find('b');
     $home = $site->find('home');
     $pages = new Pages();
     $pages->add($a);
     $pages->add($b);
     $pages->add($home);
     return $pages;
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:13,代码来源:PagesTest.php

示例14: signupAction

 public function signupAction()
 {
     if (!$this->getRequest()->isPost()) {
         $this->addErrorMessage("Form was not properly posted.");
         $this->_forward('index');
     }
     // Retrieve the form values and its values
     $form = $this->getForm();
     $valid = $form->isValid($_POST);
     $values = $form->getValues();
     $username = $values['username'];
     $email = $values['email'];
     $password = $values['password'];
     // Validate the form itself
     if (!$form->isValid($_POST)) {
         // Failed validation; redisplay form
         $this->view->form = $form;
         $this->addErrorMessage("Your form contains some errors, please correct them and submit this form again");
         return $this->_forward('register');
     }
     // Register user
     $users = new Users();
     $user = $users->addUser($username, $password, $email);
     // Add some default widgets to the user
     $widgets = new Widgets(array(Stuffpress_Db_Table::USER => $user->id));
     $widgets->addWidget('search');
     $widgets->addWidget('rsslink');
     $widgets->addWidget('links');
     $widgets->addWidget('lastcomments');
     $widgets->addWidget('archives');
     $widgets->addWidget('logo');
     // Add some default properties
     $properties = new Properties(array(Stuffpress_Db_Properties::KEY => $user->id));
     $properties->setProperty('theme', 'clouds');
     $properties->setProperty('title', ucfirst($username));
     $properties->setProperty('subtitle', "my life online");
     // Add the storytlr data source
     StuffpressModel::forUser($user->id);
     // Add default pages
     $pages = new Pages(array(Stuffpress_Db_Table::USER => $user->id));
     //$pages->addPage('dashboard', 'Home');
     $pages->addPage('lifestream', 'Stream');
     $pages->addPage('stories', 'Stories');
     // Send the user a verification email
     Stuffpress_Emails::sendWelcomeEmail($email, $username, $password, $user->token);
     // Done !
     $this->view->username = $username;
     $this->view->email = $email;
     $this->render('success');
 }
开发者ID:kreativmind,项目名称:storytlr,代码行数:50,代码来源:RegisterController.php

示例15: indexAction

 function indexAction()
 {
     // retrieve the ID of the requested page
     $pageID = $this->view->pageID = $this->_getParam('ID');
     $pageDetails = new PagesIndex();
     $pageDetailsSelect = $pageDetails->select();
     $pageDetailsSelect->where('PI_PageID = ?', $pageID)->where('PI_LanguageID = ?', $this->_defaultEditLanguage);
     $pageDetailsData = $pageDetails->fetchRow($pageDetailsSelect)->toArray();
     $this->view->assign("pageTitle", $pageDetailsData["PI_PageTitle"]);
     $authData = $this->view->user;
     $authID = $authData['EU_ID'];
     if (Cible_FunctionsAdministrators::checkAdministratorPageAccess($authID, $pageID, "data")) {
         $authData = $this->view->user;
         $authID = $authData['EU_ID'];
         if (Cible_FunctionsAdministrators::checkAdministratorPageAccess($authID, $pageID, "structure")) {
             $this->view->assign('hasAccessToStructure', true);
         }
         // Retrieve the page view layout
         $page = new Pages();
         $page_select = $page->select()->setIntegrityCheck(false);
         $page_select->from('Pages')->join('Views', 'Pages.P_ViewID = Views.V_ID')->where('P_ID = ?', $pageID);
         $page_info = Cible_FunctionsPages::getPageViewDetails($pageID);
         $template_file = 'index/' . $page_info['V_Path'];
         $_zone_count = $page_info['V_ZoneCount'];
         // make a request to get all the blocks to be displayed
         $blocks = new Blocks();
         $select = $blocks->select()->setIntegrityCheck(false);
         $select->from('Blocks')->join('Modules', 'Modules.M_ID = Blocks.B_ModuleID')->join('Pages', 'Blocks.B_PageID = P_ID')->join('BlocksIndex', 'Blocks.B_ID = BlocksIndex.BI_BlockID')->where('Blocks.B_PageID = ?', $pageID)->where('BlocksIndex.BI_LanguageID = ?', Zend_Registry::get('languageID'))->order('Blocks.B_Position ASC');
         //Send the results to the view
         $rows = $blocks->fetchAll($select);
         $_blocks = array();
         foreach ($rows as $row) {
             // create the placeholder object if not already defined
             if (!isset($_blocks[$row['B_ZoneID']])) {
                 $_blocks[$row['B_ZoneID']] = array();
             }
             $_blocks[$row['B_ZoneID']][] = $row->toArray();
         }
         $this->view->assign('template_file', $template_file);
         $this->view->assign('zone_count', $_zone_count);
         $this->view->assign('blocks', $_blocks);
         // Load the modules in the view
         $Modules = new Modules();
         $modules = $Modules->fetchAll();
         $this->view->assign('modules', $modules->toArray());
     } else {
         $this->view->assign('template_file', "");
         $this->view->assign('error_message_permission', $this->view->getCibleText('error_message_permission'));
     }
 }
开发者ID:anunay,项目名称:stentors,代码行数:50,代码来源:IndexController.php


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