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


PHP Typeframe::Allow方法代码示例

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


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

示例1: testNewsIndex

 public function testNewsIndex()
 {
     /* Assertions:
      * Site has at least one news page (required for tests).
      * All pages return 200 (public) or 403 (login required).
      * At least one news page is public (required for tests).
      */
     $newsPages = Typeframe::Registry()->applicationUrls('News');
     $this->assertTrue(count($newsPages), "No news pages to test.");
     foreach ($newsPages as $page) {
         $this->get($page);
         if (Typeframe::Allow($page)) {
             $validResponse = 200;
             $this->availablePage = $page;
         } else {
             $validResponse = 403;
         }
         $this->assertTrue($this->responseCode() == $validResponse, "{$page} returned {$this->responseCode()} (expected {$validResponse})");
     }
     $this->assertTrue(count($newsPages) == 0 || $this->availablePage, "No public news pages available for tests.");
 }
开发者ID:ssrsfs,项目名称:blg,代码行数:21,代码来源:integration.php

示例2: array

<?php

if (Typeframe::Allow(TYPEF_WEB_DIR . '/admin/seo-head')) {
    $inserts = $pm->getVariable('inserts');
    if (!is_array($inserts)) {
        $inserts = array();
    }
    $seo = array();
    $seo[] = array('name' => 'seo_head_title', 'label' => 'Page Title', 'type' => 'text');
    $seo[] = array('name' => 'seo_head_description', 'label' => 'Meta Description', 'type' => 'text');
    $seo[] = array('name' => 'seo_head_keywords', 'label' => 'Meta Keywords', 'type' => 'text');
    $pm->setVariable('inserts', array_mergs($seo, $inserts));
}
开发者ID:ssrsfs,项目名称:blg,代码行数:13,代码来源:page-seo-head.php

示例3: __construct

 public function __construct($id = null)
 {
     $this->_tablename = '#__download';
     $this->_pks = array('fileid');
     $this->_aicolumn = 'fileid';
     $this->_isent = true;
     $this->_entpropagation = DAO::ENTPROPAGATION_PROPAGATE;
     $this->_datecreatedcolumn = 'datecreated';
     $this->_datemodifiedcolumn = 'datemodified';
     $this->_includeForeign('Download_Category', 'categoryid', 'categoryid', false, 'category');
     $this->_includeForeign('Download_Tag', 'fileid', 'fileid', true, 'tags');
     if ($id) {
         $this->set('fileid', (int) $id);
         $this->load();
     } else {
         // so _select is accessible
         $this->_copySelect();
         // sort articles by publication date
         $this->_select->order('filetitle');
         // limit to 'published' if non-admin
         if (!Typeframe::Allow(TYPEF_WEB_DIR . '/admin/downloads')) {
             $this->_select->where('status = ?', self::STATUS_PUBLISHED);
         }
     }
 }
开发者ID:ssrsfs,项目名称:blg,代码行数:25,代码来源:download.class.php

示例4: NOW

<?php

if (Typeframe::Allow(TYPEF_WEB_DIR . '/admin/users')) {
    // get number of users online
    $users = new Model_User();
    $users->where('DATE_ADD(lastrequest, INTERVAL 30 MINUTE) > NOW()');
    $data = $pm->data();
    $data['admin_users'] = array();
    $data['admin_users']['online'] = $users;
    $pm->addLoop('admin_panels', array('name' => 'Users', 'template' => '/admin/users/panel.inc.html'));
}
开发者ID:ssrsfs,项目名称:blg,代码行数:11,代码来源:users.php

示例5: Model_Page

<?php

if (Typeframe::Allow(TYPEF_WEB_DIR . '/admin/news') || Typeframe::Allow(TYPEF_WEB_DIR . '/admin/pages')) {
    $pages = new Model_Page();
    $pages->where('application IN ?', array('News', 'News RSS'));
    foreach ($pages->getAll() as $page) {
        $pm->addLoop('admin_pages', $page);
    }
}
if (Typeframe::Allow(TYPEF_WEB_DIR . '/admin/news')) {
    $admin_news = array();
    $articles = new Model_News_Article();
    $admin_news['totalarticles'] = $articles->getTotal();
    $articles = new Model_News_Article();
    $articles->where('status = ?', 'draft');
    $admin_news['totaldrafts'] = $articles->getTotal();
    $pm->setVariable('admin_news', $admin_news);
    $pm->addLoop('admin_panels', array('name' => 'News', 'template' => '/admin/news/panel.inc.html'));
}
开发者ID:ssrsfs,项目名称:blg,代码行数:19,代码来源:news.php

示例6: array

<?php

if (Typeframe::Allow(TYPEF_WEB_DIR . '/admin/config')) {
    $admin_config = array();
    foreach (Typeframe::Registry()->configs() as $config) {
        $admin_configs[] = array('name' => $config->name());
    }
    $pm->setVariable('admin_configs', $admin_configs);
    $pm->sortLoop('admin_configs', 'name');
}
开发者ID:ssrsfs,项目名称:blg,代码行数:10,代码来源:config.php


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