public static function item_rss_listener()
 {
     $data = array('row' => self::page_data(Event::$data['data']['row']));
     $xml = View::factory('xml/page', $data)->render();
     // var_dump( $xml ); exit;
     $params = array('siteurl' => url::base(), 'title' => Kohana::config('appconf.site_name'), 'pubdate' => date('r'), 'lastbuild' => date('r'));
     $php_functions = array('date::time_rfc');
     $tmp = xsl::translate_string($xml, 'rss', $params, $php_functions);
     $tmp = str_replace('xmlns:php="http://php.net/xsl" ', '', $tmp);
     echo $tmp;
 }
Ejemplo n.º 2
0
 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);
 }
 /**
  * list the containers
  *
  * @return void
  * @author Andy Bennett
  */
 private function listing()
 {
     $data = array('action' => 'edit', 'name' => null, '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, 'page_plugins_list', array(), array(''));
     $c = View::factory('pages/page_plugins_list', array('list' => $l, 'controller' => 'page_plugins'))->render();
     preg_match_all('/{pid=([0-9]+)}/', $c, $matches);
     $count = count($matches[0]);
     for ($i = 0; $i < $count; $i++) {
         $c = str_replace($matches[0][$i], plugins::page_plugins_admin($matches[1][$i]), $c);
     }
     $content = array();
     $content['content'] = new stdClass();
     $content['content']->title = 'Page Plugins';
     $content['content']->copy = $c;
     Assets::instance()->add_css('/cache/css/display');
     Assets::instance()->add_javascript('/cache/js/display');
     $container = Container::instance('display')->render($content);
     Display::instance()->display($container);
 }