Ejemplo n.º 1
0
 public static function fetch()
 {
     if (!isset(self::$instance)) {
         $c = PERCH_RUNWAY ? 'PerchContent_Runway' : __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
 public static function get_helper_js()
 {
     $Settings = PerchSettings::fetch();
     if ($Settings->get('content_frontend_edit')->val()) {
         $Content = PerchContent::fetch();
         $Page = $Content->get_page();
         $r = '';
         if (is_object($Page)) {
             $r = '<script src="' . PERCH_LOGINPATH . '/core/assets/js/public_helper.js" async></script>';
             $r .= '<script async>var cms_path=\'' . PerchUtil::html(PERCH_LOGINPATH . '/core/apps/content/page/?id=' . $Page->id()) . '\';</script>';
         }
         return $r;
     }
     return false;
 }
Ejemplo n.º 3
0
function perch_page_modified($opts = array(), $return = false)
{
    $Content = PerchContent::fetch();
    $Page = $Content->get_page();
    if (!$Page) {
        return '';
    }
    $default_opts = array('format' => '%d %B %Y, %H:%M');
    if (is_array($opts)) {
        $opts = array_merge($default_opts, $opts);
    } else {
        $opts = $default_opts;
    }
    $r = strftime($opts['format'], strtotime($Page->pageModified()));
    if ($return) {
        return $r;
    }
    echo $r;
}