48 $this->
page = Cache::get(
"fakoli_admin_pages_$identifier");
49 if ($this->
page)
return;
57 throw new FakoliException(
"Missing or ambiguous page identifier '$identifier'");
61 Cache::put(
"fakoli_admin_pages_$identifier", $this->
page);
78 global $auto_form_defaults;
79 $auto_form_defaults[
"default_layout"] =
"table";
91 include
$page->server_path;
95 echo $e->getMessage();
121 preg_match_all(
"/\{var:(.*?)\}/", $template, $vars, PREG_SET_ORDER);
123 foreach($vars as $var)
127 $template = str_replace($expr, $
$name, $template);
130 $charset = strtolower(ini_get(
"default_charset"));
131 $template = str_replace(
"{default_charset}",
$charset, $template);
133 preg_match_all(
"/\{config:(.*?)\}/", $template, $vars, PREG_SET_ORDER);
135 foreach($vars as $var)
139 $template = str_replace($expr,
$config[
$name], $template);
144 $help =
"<a href='#' onclick='popup(\"/action/admin/help?src={$component->name}&page={$page->identifier}\", \"help\", 940, 500, \"toolbar=0,location=0,scrollbars=1,resizable=1\"); return false;'> Help </a>";
146 $template = str_replace(
"{help}",
$help, $template);
148 if (
$config[
'prettyURLs'] ===
false)
150 $template = preg_replace(
"/(href|src|action)=(['\"])\\/?([\\w\\d_]+?)\\?/i",
"$1=$2/page.php?identifier=$3&", $template);
151 $template = preg_replace(
"/(href|src|action)=(['\"])\\/?([\\w\\d_]+?)[\"']/i",
"$1=$2/page.php?identifier=$3$2", $template);
152 $template = preg_replace(
"/go\\(([\"'])\\/?([\\w\\d_]+?)\\?/",
"go($1/page.php?identifier=$2&", $template);
153 $template = preg_replace(
"/go\\(([\"'])\\/?([\\w\\d_]+?)[\"']/",
"go($1/page.php?identifier=$2$1", $template);
164 private function formatIcon(
$icon)
166 if (!
$icon)
return "<i class='fas fa-fw'></i>";
167 if (endsWith(
$icon,
".svg"))
169 return "<i class='fas fa-fw' style='background: url({$icon}) center center no-repeat; background-size: contain; height:1em'></i>";
171 else if (preg_match(
'/^fa.?\s/',
$icon))
173 return "<i class='{$icon} fa-fw'></i>";
177 return "<i class='fas fa-{$icon} fa-fw'></i>";
184 if (!$admin_menu)
return "";
200 $submenu =
" <h4 class=\"toggler atStart\">{$icon} {$section}</h4>\n <div class=\"atStart\">\n";
202 foreach(
$items as $item => $properties)
206 $class =
'selectedadminitem';
207 $selectedMenuSectionIdx = $menuSectionIdx;
214 $icon = $icons[$item];
219 if (checkRole($properties[
"role"]))
221 $submenu .=
"<a class='$class' href='{$properties['page']}{$menu_params}'>{$icon} {$item}</a>\n";
226 $submenu .=
"</div>";
237 if (!$selectedMenuSectionIdx) $selectedMenuSectionIdx = 0;
243 <script type=
"text/javascript">
244 window.addEvent(
'domready',
function() {
246 var accordion =
new Accordion(
'h4.atStart',
'div.atStart', {
249 initialDisplayFx:
false,
250 display: $selectedMenuSectionIdx,
251 onActive:
function(toggler, element){
252 toggler.addClass(
"active");
255 onBackground:
function(toggler, element){
256 toggler.removeClass(
"active");
258 }, document.id(
'accordion'));
263 $menu = ob_get_contents();
formatMenu($admin_menu, $icons)
AdminPageView($identifier)
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
FakoliException is the base exception class for all Fakoli errors.
static getStyles()
Returns the HTML link tags for CSS files specified by the registered components in their manifest fil...
static resolveResource($resource, $component="")
Resolves the path to a web resource based on the PHP include path.
static getScripts()
Returns the HTML scripts tags for Javascript files specified by the registered components in their ma...
static getAdminIcons()
Builds the admin icon map.
static getAdminMenu()
Builds the administration menu, combining menu items supplied by the registered components in their m...
$method
Pull out a simple reference to the request method.
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content