public function ctrl($app, $method) { $appObj = View::getval("app"); foreach ($this->fields as $fld => $var) { $appObj->meta[$fld] = [!empty($this->cfg[$var]) ? $this->cfg[$var] : (!empty($var) && !empty($appObj->{$var}) ? $appObj->{$var} : ""), "property"]; } if (!empty($appObj->meta["description"])) { $appObj->meta["og:description"] = [$appObj->meta["description"], "property"]; } $appObj->meta["og:url"] = [url(), "property"]; }
public static function val2arr($s, $c = ',') { if (is_array($s)) { return $s; } elseif ($s != '') { $v = View::getval($s); if (is_array($v)) { return $v; } return str_getcsv($v, $c); } return []; }
/** * Status block event handler */ function stat() { $ret = ""; if (Core::$user->has("siteadm|webadm")) { //! if we are on an editable page $app = View::getval("app"); if (get_class($app) == "PHPPE\\Content") { //! unpiblished warning if (isset($app->publishid) && !$app->publishid) { $ret .= "<a href='" . url("cms/pages") . "?publish'><span class='btn-warning' style='padding:0px 4px 0px 4px;text-shadow:none;'>" . L("UNPUBLISHED") . "</span></a>"; } //! page info $ret .= self::statIcon("pageinfo"); //! page meta $ret .= self::statIcon("pagemeta"); //! page dds icon if (Core::$user->has("siteadm")) { $ret .= self::statIcon("pagedds"); } //! page history if ($this->revert) { $ret .= self::statIcon("pagehist"); } //! page delete $ret .= "<img style='cursor:pointer;' " . "onclick='pe.cms.pagedel(\"" . addslashes(Core::$core->url) . "\");' " . "src='images/cms/pagedel.png' " . "alt='[PAGEDEL]' " . "title='" . htmlspecialchars(L('pagedel')) . "'>"; } if (get_class($app) == "PHPPE\\Ctrl\\CMSArchive" && $this->revert) { $u = Core::$core->url . "?created=" . urlencode(trim($_REQUEST['created'])); //! page version delete $ret .= "<img style='cursor:pointer;' " . "onclick='document.location.href=\"" . $u . (isset($_REQUEST['diff']) ? '' : '&diff') . "\";' " . "src='images/cms/pagediff.png' " . "alt='[PAGEDIFF]' " . "title='" . htmlspecialchars(L('pagediff')) . "'>"; //! revert page to version $ret .= "<img style='cursor:pointer;' " . "onclick='document.location.href=\"" . $u . "&revert\";' " . "src='images/cms/pagerevert.png' " . "alt='[PAGEREVERT]' " . "title='" . htmlspecialchars(L('pagerevert')) . "'>"; //! page history $ret .= self::statIcon("pagehist"); //! page version delete $ret .= "<img style='cursor:pointer;' " . "onclick='document.location.href=\"" . $u . "&pagedel\";' " . "src='images/cms/pagedel.png' " . "alt='[PAGEDEL]' " . "title='" . htmlspecialchars(L('pagedel')) . "'>"; } //! page add $ret .= self::statIcon("pageadd"); } return $ret; }