Esempio n. 1
0
 public function __construct(Request $request)
 {
     $this->request = $request;
     parent::__construct($request);
     // Load the page class
     $this->page = Pages::instance();
 }
Esempio n. 2
0
 /**
  * Returns the value of a view ane merges the config with any data passed to it
  *
  * @param   string        name of view
  * @param   boolean|array optional array of data to pass to the view
  * @param   string        file extension
  * @param   boolean|int   lifetime of cache. if set to true it will use the default
  *                            cache from the pages config or use an int if it is passed one
  * @return  string        contents of view or cache file
  */
 public static function view($view, $config = FALSE, $type = FALSE, $lifetime = FALSE)
 {
     $page = Pages::instance();
     // Setup caching and return the cache file it it works
     if ($lifetime) {
         $cache = new Cache();
         $cache_name = $page->getCacheIdForView($view . $type . serialize($data));
         if ($output = $cache->get($cache_name)) {
             return $output;
         }
     }
     // Load the view
     $view = new View($view, $config, $type);
     $output = $view->render();
     // Convert to markdown automatically
     if ($type == 'markdown' || $type == 'mdown' || $type == 'md') {
         $output = markdown::to_html($output);
     }
     // Store into cache
     if ($lifetime) {
         // Setup lifetime
         if ($lifetime === TRUE) {
             $lifetime = $page->cache_lifetime;
         } else {
             $lifetime = (int) $lifetime;
         }
         // Store the cache
         $cache->set($cache_name, $output, NULL, $lifetime);
     }
     return $output;
 }
Esempio n. 3
0
 /**
  * Initialize Fansoro Pages
  *
  *  <code>
  *      Pages::init();
  *  </code>
  *
  * @access  public
  */
 public static function init()
 {
     return !isset(self::$instance) and self::$instance = new Pages();
 }
Esempio n. 4
0
 public function __construct()
 {
     parent::__construct();
     // Load the page class
     $this->page = Pages::instance();
 }
Esempio n. 5
0
                active: false,
                collapsible: true,
                heightStyle: "content"
            });
            // Hover states on the static widgets
            $("#dialog-link, #icons li").hover(
                function () {
                    $(this).addClass("ui-state-hover");
                },
                function () {
                    $(this).removeClass("ui-state-hover");
                }
            );
        });
	</script>
    
    
</head>
<body>
  <header class="grid_12 alpha">
    <nav class="grid_12 alpha">
      <?php 
echo Pages::instance()->BuildMenu($user);
?>
    </nav>
  </header>
    <div class="container">
	<div class="grid_<?php 
echo $user->isLoggedIn() ? 12 : 8;
?>
 alpha">