/** * Init results params from skin template params. It's used when Results table is filled from ajax result. * * @param string the template param which can have values( 'admin', 'front' ) * @param string the name of the skin */ function init_params_by_skin($skin_type, $skin_name) { switch ($skin_type) { case 'admin': // admin skin type global $adminskins_path; require_once $adminskins_path . $skin_name . '/_adminUI.class.php'; $this->params = AdminUI::get_template('Results'); break; case 'front': // front office skin type global $skins_path; require_once $skins_path . $skin_name . '/_skin.class.php'; $this->params = Skin::get_template('Results'); break; default: debug_die('Invalid results template param!'); } }
/** * Load template params from current skin */ function load_template() { $params = array('toolbar_before' => '<div class="edit_toolbar $toolbar_class$">', 'toolbar_after' => '</div>', 'toolbar_title_before' => '', 'toolbar_title_after' => '', 'toolbar_group_before' => '', 'toolbar_group_after' => ' ', 'toolbar_button_class' => 'quicktags'); if (is_admin_page()) { // Get plugin template from backoffice skin if (is_logged_in()) { global $current_User, $UserSettings, $adminskins_path; $admin_skin = $UserSettings->get('admin_skin', $current_User->ID); require_once $adminskins_path . $admin_skin . '/_adminUI.class.php'; $AdminUI = new AdminUI(); $skin_template = $AdminUI->get_template('plugin_template'); } } else { // Get plugin template from frontoffice skin global $Blog; if (!empty($Blog)) { $skin_ID = $Blog->get_skin_ID(); $SkinCache =& get_SkinCache(); if ($Skin =& $SkinCache->get_by_ID($skin_ID, false, false)) { $skin_template = $Skin->get_template('plugin_template'); } } } if (empty($skin_template)) { // Use default template params when they are not set by skin $this->template = $params; } else { // Merge default params with current skin params $this->template = array_merge($params, $skin_template); } }