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


PHP PageType::GetPageTypes方法代码示例

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


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

示例1: PublishRssForPageTypes

 public static function PublishRssForPageTypes($siteUniqId, $root = '../')
 {
     $site = Site::GetBySiteUniqId($siteUniqId);
     $list = PageType::GetPageTypes($site['SiteId']);
     foreach ($list as $row) {
         Publish::PublishRssForPageType($siteUniqId, $row['PageTypeId'], $root);
     }
 }
开发者ID:eavesmonkey,项目名称:respond,代码行数:8,代码来源:Publish.php

示例2: get

 /**
  * @method GET
  */
 function get()
 {
     // get token
     $token = Utilities::ValidateJWTToken(apache_request_headers());
     // check if token is not null
     if ($token != NULL) {
         $siteId = $token->SiteId;
         // get user
         $user = User::GetByUserId($token->UserId);
         // creates an access object
         $access = Utilities::SetAccess($user);
         // get pagetype
         $list = PageType::GetPageTypes($siteId);
         // allowed
         $allowed = array();
         // create a root element in the array
         $root = array('FriendlyId' => '', 'IsSecure' => 0, 'LastModifiedBy' => NULL, 'LastModifiedDate' => NULL, 'Layout' => 'content', 'PageTypeId' => -1, 'PageTypeId' => -1, 'SiteId' => -1, 'Stylesheet' => 'content');
         // return the entire list for all access
         if ($access['CanAccess'] == 'All') {
             $allowed = $list;
             array_unshift($allowed, $root);
         } else {
             foreach ($list as $row) {
                 $pageTypeId = $row['PageTypeId'];
                 if (Utilities::CanPerformAction('root', $access['CanAccess']) != false) {
                     array_push($allowed, $root);
                 }
                 //print('$pageTypeId='.$pageTypeId.' access='.$access['CanAccess']);
                 // check permissions
                 if (Utilities::CanPerformAction($pageTypeId, $access['CanAccess']) != false) {
                     array_push($allowed, $row);
                 }
             }
         }
         // return a json response
         $response = new Tonic\Response(Tonic\Response::OK);
         $response->contentType = 'application/json';
         $response->body = json_encode($allowed);
         return $response;
     } else {
         // unauthorized access
         return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
     }
 }
开发者ID:nboss,项目名称:respond,代码行数:47,代码来源:pageType.php

示例3: PublishRssForPageTypes

 public static function PublishRssForPageTypes($site)
 {
     $list = PageType::GetPageTypes($site['SiteId']);
     foreach ($list as $row) {
         Publish::PublishRssForPageType($site, $row['PageTypeId']);
     }
 }
开发者ID:bladep911,项目名称:respond,代码行数:7,代码来源:Publish.php

示例4: get

 /**
  * @method GET
  */
 function get()
 {
     // get an authuser
     $authUser = new AuthUser();
     if (isset($authUser->UserUniqId)) {
         // check if authorized
         $siteId = $authUser->SiteId;
         // get pagetype
         $list = PageType::GetPageTypes($siteId);
         // allowed
         $allowed = array();
         // return the entire list for all access
         if ($authUser->Access == 'All') {
             $allowed = $list;
         } else {
             foreach ($list as $row) {
                 $pageTypeUniqId = $row['PageTypeUniqId'];
                 // check permissions
                 if (Utilities::CanPerformAction($pageTypeUniqId, $authUser->Access) !== false) {
                     array_push($allowed, $row);
                 }
             }
         }
         // return a json response
         $response = new Tonic\Response(Tonic\Response::OK);
         $response->contentType = 'application/json';
         $response->body = json_encode($allowed);
         return $response;
     } else {
         // unauthorized access
         return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
     }
 }
开发者ID:eavesmonkey,项目名称:respond,代码行数:36,代码来源:pageType.php


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