static function ExecInfo($scriptinfo) { global $dataDir; ob_start(); gpOutput::ExecInfo($scriptinfo); return ob_get_clean(); }
static function ExecArea($info) { //retreive from gadget cache if set if (isset($info['gpOutCmd'])) { $gadget = $info['gpOutCmd']; if (substr($gadget, 0, 7) == 'Gadget:') { $gadget = substr($gadget, 7); } if (isset(self::$gadget_cache[$gadget])) { echo self::$gadget_cache[$gadget]; return; } } $info += array('arg' => ''); $args = array($info['arg'], $info); gpOutput::ExecInfo($info, $args); }
/** * Execute the php code associated with a $hook * @param string $hook * @param array $hook_info * @param array $args * */ static function ExecHook($hook, $info, $args = array()) { global $dataDir, $gp_current_hook; if (gp_safe_mode) { if (isset($args[0])) { return $args[0]; } return; } if (!is_array($args)) { $args = array($args); } $gp_current_hook[] = $hook; //value if (!empty($info['value'])) { $args[0] = $info['value']; } $args = gpOutput::ExecInfo($info, $args); array_pop($gp_current_hook); if (isset($args[0])) { return $args[0]; } return false; }
/** * Find the requested admin script and execute it if the user has permissions to view it * */ function RunAdminScript() { global $dataDir, $langmessage; //resolve request for /Admin_Theme_Content if the request is for /Admin_Theme_Conent/1234 $parts = explode('/', $this->requested); do { $request_string = implode('/', $parts); $scriptinfo = false; $scripts = admin_tools::AdminScripts(); if (isset($scripts[$request_string])) { $scriptinfo = $scripts[$request_string]; if (admin_tools::HasPermission($request_string)) { admin_display::OrganizeFrequentScripts($request_string); gpOutput::ExecInfo($scriptinfo); return; } else { message($langmessage['not_permitted']); $parts = array(); } } elseif (count($scripts) > 0) { //check case $case_check = array_keys($scripts); $case_check = array_combine($case_check, $case_check); $case_check = array_change_key_case($case_check, CASE_LOWER); $lower = strtolower($request_string); if (isset($case_check[$lower])) { $location = common::GetUrl($case_check[$lower], http_build_query($_GET), false); common::Redirect($location); } } //these are here because they should be available to everyone switch ($request_string) { case 'Admin_Browser': includeFile('admin/admin_browser.php'); new admin_browser(); return; case 'Admin_Preferences': $this->label = $langmessage['Preferences']; includeFile('admin/admin_preferences.php'); new admin_preferences(); return; case 'Admin_About': $this->label = 'About gpEasy'; includeFile('admin/admin_about.php'); new admin_about(); return; case 'Admin_Finder': if (admin_tools::HasPermission('Admin_Uploaded')) { includeFile('thirdparty/finder/connector.php'); return; } break; } array_pop($parts); } while (count($parts)); $this->AdminPanel(); }
function ExecArea($info) { global $GP_GADGET_CACHE; //retreive from gadget cache if set if (isset($info['gpOutCmd']) && isset($GP_GADGET_CACHE[$info['gpOutCmd']])) { echo $GP_GADGET_CACHE[$info['gpOutCmd']]; return; } $info += array('arg' => ''); $args = array($info['arg'], $info); gpOutput::ExecInfo($info, $args); }