本文整理汇总了PHP中Display::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Display::instance方法的具体用法?PHP Display::instance怎么用?PHP Display::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
parent::__construct();
parent::init();
acl_helper::acl_redirect(steamauth_helper::get_role(), 'admin');
Display::instance()->set_template('template-admin');
}
示例2: error_404_listener
/**
* listener for error 404s
*
* @return void
* @author Andy Bennett
*/
function error_404_listener()
{
header('HTTP/1.1 404 File Not Found');
Display::instance()->set_template('template-error');
Display::instance()->add_data('page_id', 'page-not-found');
View::factory('common/error_404')->render(true);
die;
}
示例3: render
/**
* render
*
* @return void
* @author Andy Bennett
*/
public static function render()
{
$content = array();
$content['content'] = new stdClass();
$content['content']->title = '';
$content['content']->copy = Event::$data;
$container = Container::instance(1)->render($content, null);
Display::instance()->display($container);
}
示例4: render
/**
* render list of plugins
*
* @param string $copy
* @return void
* @author Andy Bennett
*/
function render($copy)
{
$admin_container = Kohana::config('containers.admin_container');
$content = new stdClass();
$content->header = 'Containers Admin';
$content->sub_header = '';
$content->copy = $copy;
$page_content = Container::instance()->init($admin_container)->render($content);
Display::instance()->display($page_content);
}
示例5: __construct
function __construct()
{
if (!User::instance()->id) {
url::redirect('/auth/login');
}
Acl::instance()->redirect(User::instance()->get_role(), 'admin', null, '/auth/login');
parent::__construct();
$type = '-' . Input::instance()->get('type', '');
Display::instance()->set_template($type == '-' ? 'template' : 'template' . $type);
}
示例6: item_html_listener
public static function item_html_listener()
{
$pid = Event::$data['data']['row']->pid;
$cid = Event::$data['data']['row']->container;
$content = array();
$content['content'] = new stdClass();
$content['content']->title = Event::$data['data']['row']->title;
$content['content']->copy = View::factory('pages/' . Event::$data['view'], Event::$data['data'])->render();
$container = Container::instance($cid)->render($content, false, $pid);
Display::instance()->display($container);
}
示例7: add_map
public static function add_map($data = array(), $args = null)
{
self::append_js();
$map = new View('gmap');
$map->set('result', $data);
if (is_object($args)) {
foreach ($args as $a => $v) {
$map->{$a} = $v;
}
}
$extraHeadContent = $map->render();
Display::instance()->append_data('extraHeadContent', $extraHeadContent);
}
示例8: item_html_listener
public static function item_html_listener()
{
$pid = Event::$data['data']['row']->pid;
$cid = Event::$data['data']['row']->container;
$content_template = Event::$data['data']['row']->content_template;
$content_template = $content_template == '' ? 'template-0' : $content_template;
$content = array();
$content['content'] = new stdClass();
$content['content']->title = Event::$data['data']['row']->title;
$content['content']->copy = View::factory('/containers/content_templates/' . $content_template, Event::$data['data'])->render();
Display::instance()->add_data('page_version', Event::$data['data']['row']->version);
$container = Container::instance($cid)->render($content, false, $pid);
Display::instance()->display($container);
}
示例9: index
/**
* Get plugins and show
*
* @return void
* @author Dan Chadwick
*/
public function index()
{
Event::add('steamcore.aclcheck', array('acl_listeners', 'redirect'));
$data = array('action' => 'admin', 'name' => null, 'role' => User::instance()->get_role());
Event::run('steamcore.aclcheck', $data);
Assets::instance()->add_css('admin');
$view = View::factory('plugins_list');
$view->plugins = PluginManager::instance()->getPluginObjects();
$content = array('content' => new stdClass());
$content['content']->title = 'Plugins Admin';
$content['content']->copy = $view->render();
Assets::instance()->add_css('/cache/css/display');
Assets::instance()->add_javascript('/cache/js/display');
Display::instance()->display(Container::instance('display')->render($content));
}
示例10: admin
/**
* listing
*
* @return void
* @author Andy Bennett
*/
public function admin()
{
$data = array('action' => 'edit', 'name' => $this->name, 'role' => User::instance()->get_role());
Event::run('steamcore.aclcheck', $data);
$blog = URI::instance()->segment(3, 1);
$nodes = ORM::factory('blogpost')->where(array('lvl' => 1, 'blog_id' => $blog))->orderby(array('date_added' => 'DESC'))->find_all();
$lvl = ORM::factory('blogpost')->level_column;
$data = array('nodes' => $nodes, 'level_column' => $lvl, 'controller' => 'blogposts');
$copy = View::factory('blog/postslist_admin', $data)->render();
$content = array();
$content['content'] = new stdClass();
$content['content']->title = 'Blog Posts';
$content['content']->copy = $copy;
$container = Container::instance(3)->render($content);
Display::instance()->display($container);
}
示例11: getContentBody
/**
* get content body
*
* @return void
* @author Andy Bennett
*/
function getContentBody()
{
$blog = Blog::factory();
// var_dump($blog);exit;
$data = array();
if (count(Router::$arguments) > 1) {
Display::instance()->add_data('pageclass', 'blog-subpage');
$plugdata = array('content' => $blog->view(), 'comment' => $blog->comment(), 'p' => $this);
$data['content'] = View::factory('blog/plugin-post', $plugdata)->render();
} else {
$plugdata = array('content' => $blog->blog(1), 'p' => $this);
$data['content'] = View::factory('blog/plugin-posts', $plugdata)->render();
}
$data['comments'] = $blog->latest_comments(1, 5);
$data['p'] = $this;
return View::factory('blog/plugin-wrapper', $data)->render();
}
示例12: admin
public function admin()
{
$data = array('action' => 'edit', 'name' => $this->name, 'role' => User::instance()->get_role());
Event::run('steamcore.aclcheck', $data);
$root = ORM::factory('pages_position')->where('lft', 0)->find();
$xml = $root->render_descendants('pages', false)->render();
$l = xsl::translate_string($xml, 'pages_admin', array(), array('pages_helper::check_acl'));
$pages = pages_helper::get_pages($root = true);
$move = View::factory('pageadmin/movepage', array('pagelist' => $pages))->render();
$c = View::factory('pages/pages', array('list' => $l, 'controller' => 'pages', 'move' => $move))->render();
$content = array();
$content['content'] = new stdClass();
$content['content']->title = 'Pages';
$content['content']->copy = $c;
$container = Container::instance(3)->render($content);
Display::instance()->display($container);
}
示例13: init
/**
* initialise the container
*
* @param string $container_id
* @param boolean $use_defaults
* @return void
* @author Andy Bennett
*/
function init($container_id, $use_defaults = true)
{
$this->container_id = $container_id;
$details = $this->model->get_container($this->container_id);
if (!is_object($details)) {
throw new Kohana_User_Exception("Containers Error", "Container id " . $container_id . " cannot be found");
}
$this->title = $details->title;
$this->template = $details->template;
if ($use_defaults) {
$this->add_block('left_column', array('column' => 'left-col'));
$this->add_block('mid_column', array('column' => 'middle-col'));
$this->add_block('right_column', array('column' => 'right-col'));
$this->add_block('section_nav', array('column' => 'nav'));
}
Display::instance()->set_container(true);
return $this;
}
示例14: index
/**
* display the tree
*
* @return void
* @author Andy Bennett
*/
public function index()
{
Display::instance()->add_css('app/admin');
Display::instance()->add_css('app/apage');
// $filepath = Kohana::find_file( 'xml', 'sitemap', true, 'xml');
// $xml = simplexml_load_file( $filepath );
$xml = Sitemap::instance()->get_sitemap();
Display::instance()->add_css('/cache/css/tree');
Display::instance()->add_javascript('global/core/effects');
Display::instance()->add_javascript('global/core/dragdrop');
Display::instance()->add_javascript('/cache/js/Tree');
$js = new View('tree_js', array('struct' => tree_helper::create_struct($xml)), FALSE);
Display::instance()->append_data('extraHeadContent', $js);
$content = new stdClass();
Display::instance()->add_data('header', 'Pages Admin');
Display::instance()->add_data('sub_header', '');
$tb = new View('tree_body');
$content = $tb;
Display::instance()->add_data('content', $content);
Display::instance()->display();
}
示例15: comments_list
/**
* get list of comments
*
* @param string $post_id
* @return void
* @author Andy Bennett
*/
public function comments_list($post_id)
{
try {
$node = ORM::factory('blogpost', $post_id);
if ($node->has_children()) {
$data = array();
$data['post_title'] = $node->title;
$data['nodes'] = $node->descendants()->find_all();
$data['controller'] = 'blog_comments';
$copy = View::factory('blog/post_comments_admin', $data)->render();
$content = array();
$content['content'] = new stdClass();
$content['content']->title = 'Blog Post Comments';
$content['content']->copy = $copy;
$container = Container::instance(3)->render($content);
Display::instance()->display($container);
}
} catch (Exception $e) {
var_dump($e->getMessage());
Kohana::log('debug', $e->getMessage());
}
}