本文整理汇总了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.");
}
示例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));
}
示例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);
}
}
}
示例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'));
}
示例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'));
}
示例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');
}