$template->set_file('page', 'access.htt'); $template->set_block('page', 'main_block', 'main'); $template->set_block('main_block', 'users_block', 'user'); $template->set_block('main_block', 'groups_block', 'group'); // Insert values into the template object $template->set_var(array('ADMIN_URL' => ADMIN_URL, 'THEME_URL' => THEME_URL, 'WB_URL' => WB_URL)); /** * Insert permission values into the template object * Deprecated - as we are using blocks. */ $display_none = "style=\"display: none;\""; if ($admin->get_permission('users') != true) { $template->set_var('DISPLAY_USERS', $display_none); } if ($admin->get_permission('groups') != true) { $template->set_var('DISPLAY_GROUPS', $display_none); } // Insert section names and descriptions $template->set_var(array('USERS' => $MENU['USERS'], 'GROUPS' => $MENU['GROUPS'], 'ACCESS' => $MENU['ACCESS'], 'USERS_OVERVIEW' => $OVERVIEW['USERS'], 'GROUPS_OVERVIEW' => $OVERVIEW['GROUPS'])); if ($admin->get_permission('users') == true) { $template->parse('main_block', "users_block", true); } if ($admin->get_permission('groups') == true) { $template->parse('main_block', "groups_block", true); } // Parse template object $template->parse('main', 'main_block', false); $template->pparse('output', 'page'); // Print admin footer $admin->print_footer();
/** Does the actual rendering of the Tool */ public function Process($echo = false) { //Set the Enviroment global $database, $admin, $TEXT, $MENU, $HEADING, $MESSAGE, $OVERVIEW; // only for Droplet Module as its using strange Globals global $twig; //check and generate vars and initialize the object $this->CheckVars(); // templateengine users like to have this in an Array $VARS = $this->GetPubVars(); // PHP templater like all vars in a direct manner extract($VARS); // Loading language files extract($this->GetLangVars($TEXT, $MENU, $HEADING, $MESSAGE, $OVERVIEW)); // Setting the Category name for breadcrumb $categoryName = $HEADING['ADMINISTRATION_TOOLS']; if ($this->toolType == "setting") { $categoryName = $MENU['SETTINGS']; } if ($this->toolType == "backend") { $categoryName = "Backend Pages"; } // locally defined function for compatibility // The following Stuff is now loaded // framework/config.php // functions.php // framework/initialize.php // framework/class.admin.php // all module and core classes are registered in Autoloader // Info.php whith slightly modified Vars // Language Vars of this Template are in // backend.js/css should be loaded by admin. (hopefully) // ok lets start output buffer As those old stuff does print and echo imediately // this makes it hard to filter later on. // Output buffer for full page ob_start(); // create admin-object but suppress headers if no page is set // for example this offers opportunety to give back files for download // this possibly creates output already // class Admin gets a if ($noPage) { $admin = new admin($this->adminSection, $this->adminAccess, false, true, $operateBuffer = false); } else { $admin = new admin($this->adminSection, $this->adminAccess, true, true, $operateBuffer = true); } // Output buffer for module only ob_start(); // for use in this class methods $this->admin = $admin; // show title if not function 'save' is requested // only if we do not look at page listing if (!$doSave and !$noPage and !preg_match("/backend/", $module_function)) { print '<h4><a href="' . $returnToTools . 'title="' . $categoryName . '">' . $categoryName . '</a>' . ' » ' . $module_name . '</h4>' . "\n"; } // eine Variable für this festlegen $oWrapper = $this; //Load actual tool require WB_PATH . '/modules/' . $toolDir . '/tool.php'; // Fetch the Buffer for later filtering $toolOutput = ob_get_clean(); // FILTER for OPF DASHBOARD just for this module(tool) if (function_exists('opf_controller')) { $toolOutput = opf_controller('backend', $toolOutput, $this->toolDir); } echo $toolOutput; // output footer if we are not in no_page mode if (!$noPage) { $admin->print_footer($activateJsAdmin = false, $operateBuffer = true); } // Fetch the Buffer for later filtering $fullOutput = ob_get_clean(); // FILTER for OPF DASHBOARD for whole page if (function_exists('opf_controller')) { $fullOutput = opf_controller('backend', $fullOutput); } // echo if set so if (!$echo) { return $fullOutput; } echo $fullOutput; return false; }