本文整理汇总了PHP中Plugin::admin方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin::admin方法的具体用法?PHP Plugin::admin怎么用?PHP Plugin::admin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::admin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin
public function admin(\Pagemill_Data $data, \Pagemill_Stream $stream)
{
$this->adminTemplate = '/admin/content/settings.plug.html';
$data = $data->fork();
$data->setArray($this->attributes());
$templates = array();
$dh = opendir(self::GetTemplateDirectory());
$dh = opendir(TYPEF_SOURCE_DIR . '/templates/content');
while (($file = readdir($dh)) !== false) {
if ($file != "." && $file != "..") {
if (is_file(self::GetTemplateDirectory() . $file)) {
if (preg_match('/.plug./', $file)) {
$source = file_get_contents(TYPEF_SOURCE_DIR . '/templates/content/' . $file);
preg_match('/pm:tmplname="([\\w\\W\\s\\S]*?)"/', $source, $matches);
if ($matches) {
$label = $matches[1];
} else {
$label = $file;
}
$templates[] = array('template' => $file, 'label' => $label);
}
}
}
}
closedir($dh);
$data['templates'] = $templates;
$plugin = Model_Plug::Get($_REQUEST['plugid']);
if ($plugin->exists()) {
$data['plugin'] = $plugin;
$data['settings'] = $plugin['settings'];
parent::admin($data, $stream);
}
}
示例2: admin
public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
{
$this->adminTemplate = '/admin/mailform/settings.plug.html';
$data = $data->fork();
$data->setArray($this->attributes());
$mailforms = new Model_Mailform();
$mailforms->where('siteid = ?', Typeframe::CurrentPage()->siteid());
$data->set('mailforms', $mailforms);
parent::admin($data, $stream);
}
示例3: admin
public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
{
$this->adminTemplate = '/admin/navigation/submenu.plug.html';
$menus = new Model_Plug();
$menus->where('plug = ?', 'Navigation');
// TODO: Clone it or find some other way to manage data conflicts
$data = $data->fork();
$data['menus'] = $menus;
parent::admin($data, $stream);
}
示例4: admin
public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
{
$this->adminTemplate = '/admin/news/feed.plug.html';
$data = $data->fork();
$categories = new Model_News_Category();
$categories->order('categoryname');
$data['categories'] = $categories;
$pages = new Model_Page();
$pages->where('application = ?', 'News');
$data['pages'] = $pages;
$data->setArray($this->attributes());
parent::admin($data, $stream);
}
示例5: admin
public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
{
// TODO: Implement
$data = $data->fork();
$data->setArray($this->attributes());
$pages = new Model_Page();
$pages->where('application = ?', 'News');
$data->set('pages', $pages);
$categories = new Model_News_Category();
$categories->order('categoryname');
$data->set('categories', $categories);
$this->adminTemplate = '/admin/news/archive.plug.html';
parent::admin($data, $stream);
}
示例6: admin
public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
{
$data = $data->fork();
$this->settings = array_merge(array('limit' => ''), $this->settings);
$data->setArray($this->settings);
$categories = new Model_News_Category();
$caegories->order('categoryname');
foreach ($categories->getAll() as $category) {
if (isset($this->settings['categoryid']) && in_array($row['categoryid'], $this->settings['categoryid'])) {
$category->set('selected', true, true);
}
}
$data->set('categories', $categories);
parent::admin($data, $stream, $tag);
}
示例7: admin
public function admin(Pagemill_Data $data, Pagemill_Stream $stream)
{
$this->adminTemplate = '/admin/navigation/index.plug.html';
$data = $data->fork();
$plugin = Model_Plug::Get($_REQUEST['plugid']);
$data['plugin'] = $plugin;
$parentid = isset($_GET['parentid']) ? $_GET['parentid'] : 0;
if ($parentid) {
$this->set_breadcrumbs($this->attributes['plugid'], Model_Nav::Get($parentid));
} else {
$this->set_breadcrumbs($this->attributes['plugid'], null);
}
//set plugid and parentid just in case we need to to be directed to the edit/add pages
$data->set('plugid', $this->attributes['plugid']);
$data->set('parentid', $parentid);
if (isset($_GET['cmd'])) {
switch ($_GET['cmd']) {
case 'add':
//return $pm->writeFile(template_path('admin/navigation/add.plug.html'));
$data['parent'] = @$_REQUEST['parent'];
$this->adminTemplate = '/admin/navigation/add.plug.html';
parent::admin($data, $stream);
return;
break;
case 'edit':
$item = Model_Nav::Get($_GET['itemid']);
$data->set('item', $item);
//return $pm->writeFile(template_path('admin/navigation/edit.plug.html'));
$this->adminTemplate = '/admin/navigation/edit.plug.html';
parent::admin($data, $stream);
return;
break;
}
}
$nav = new Model_Nav();
$nav->where('parent = ?', $parentid);
$nav->where('plugid = ?', $this->attributes['plugid']);
$items = array();
foreach ($nav->select() as $item) {
$item['link'] = $data->parseVariables(Typeframe_Attribute_Url::ConvertShortUrlToExpression($item['link']));
$items[] = $item;
}
$data->set('items', $items);
//return $pm->writeFile(template_path('admin/navigation/index.plug.html'));
parent::admin($data, $stream);
}
示例8: __
<?php
/**
* Emails plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012-2014 Romanenko Sergey / Awilum
* @version 1.0.0
*
*/
// Register plugin
Plugin::register(__FILE__, __('Emails', 'emails'), __('Emails plugin for Monstra', 'emails'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
// Load Emails Admin for Editor and Admin
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
Plugin::admin('emails', 'box');
}
示例9: __
/**
* Menu plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012-2014 Romanenko Sergey / Awilum
* @version 1.0.0
*
*/
// Register plugin
Plugin::register(__FILE__, __('Menu', 'menu'), __('Menu manager', 'menu'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) {
// Include Admin
Plugin::admin('menu', 'box');
}
// Add Plugin Javascript
Javascript::add('plugins/box/menu/js/menu.js', 'backend');
/**
* Menu Class
*/
class Menu
{
/**
* Get menu
*
* @param string $category Category name
*/
public static function get($category = '')
{
示例10: __
<?php
/**
* Dashboard plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012-2014 Romanenko Sergey / Awilum
* @version 1.0.0
*
*/
// Register plugin
Plugin::register(__FILE__, __('Dashboard', 'dashboard'), __('Dashboard plugin for Monstra', 'dashboard'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
// Load Sandbox Admin for Editor and Admin
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
Plugin::admin('dashboard', 'box');
}
示例11:
require_once Plugin::path('inc/class-fp-field.php');
// Inluding needed providers
require_once Plugin::path('providers/html.php');
require_once Plugin::path('providers/image/lorempixel.php');
require_once Plugin::path('providers/image/placeholdit.php');
require_once Plugin::path('providers/image/500px.php');
require_once Plugin::path('providers/text/base.php');
// Require the Base module
require_once Plugin::path('modules/base.php');
// Require the Meta module
require_once Plugin::path('providers/wp-meta.php');
require_once Plugin::path('modules/meta.php');
// Require the Post module
require_once Plugin::path('providers/wp-post.php');
require_once Plugin::path('modules/post.php');
// Require the Attachment module
require_once Plugin::path('providers/wp-attachment.php');
require_once Plugin::path('modules/attachment.php');
// Require the User module
require_once Plugin::path('providers/wp-user.php');
require_once Plugin::path('modules/user.php');
// Require the Term module
require_once Plugin::path('providers/wp-term.php');
require_once Plugin::path('modules/term.php');
// Require the Comment module
require_once Plugin::path('providers/wp-comment.php');
require_once Plugin::path('modules/comment.php');
// Require our Administration Class
Plugin::$admin = (require_once Plugin::path('inc/class-fp-admin.php'));
// Require our Ajax Class
Plugin::$ajax = (require_once Plugin::path('inc/class-fp-ajax.php'));
示例12: __
<?php
/**
* Files manager plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012-2014 Romanenko Sergey / Awilum
* @version 1.0.0
*
*/
// Register plugin
Plugin::register(__FILE__, __('Files manager', 'filesmanager'), __('Files manager', 'filesmanager'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
// Include Admin
Plugin::admin('filesmanager', 'box');
}
示例13: __
/**
* Blocks plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012-2014 Romanenko Sergey / Awilum
* @version 1.0.0
*
*/
// Register plugin
Plugin::register(__FILE__, __('Blocks', 'blocks'), __('Blocks manager plugin', 'blocks'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
// Include Admin
Plugin::admin('blocks', 'box');
}
// Add Plugin Javascript
Javascript::add('plugins/box/blocks/js/blocks.js', 'backend');
// Add shortcode {block get="blockname"}
Shortcode::add('block', 'Block::_content');
// Add shortcode {block_inline name="blockname"}
Shortcode::add('block_inline', 'Block::_inlineBlock');
// Add shortcode {block_inline_create name="blockname"} Block content here {/block_inline_create}
Shortcode::add('block_inline_create', 'Block::_createInlineBlock');
/**
* Block Class
*/
class Block
{
/**
示例14: __
<?php
/**
* Plugins manger plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012-2014 Romanenko Sergey / Awilum
* @version 1.0.0
*
*/
// Register plugin
Plugin::register(__FILE__, __('Plugins', 'plugins'), __('Plugins manager', 'plugins'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box');
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) {
// Include Admin
Plugin::admin('plugins', 'box');
}
示例15: __
/**
* Sandbox plugin
*
* @package Monstra
* @subpackage Plugins
* @author Romanenko Sergey / Awilum
* @copyright 2012-2014 Romanenko Sergey / Awilum
* @version 1.0.0
*
*/
// Register plugin
Plugin::register(__FILE__, __('Sandbox', 'sandbox'), __('Sandbox plugin for Monstra', 'sandbox'), '1.0.0', 'Awilum', 'http://monstra.org/', 'sandbox');
// Load Sandbox Admin for Editor and Admin
if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) {
Plugin::admin('sandbox');
}
/**
* Sandbox class
*/
class Sandbox extends Frontend
{
/**
* Sandbox main function
*/
public static function main()
{
// Do something...
}
/**
* Set Sandbox title