/** * Contructor of the Dashboards class */ public function __construct() { wfProfileIn('BS::' . __METHOD__); $this->mExtensionFile = __FILE__; $this->mExtensionType = EXTTYPE::SPECIALPAGE; $this->mInfo = array(EXTINFO::NAME => 'Dashboards', EXTINFO::DESCRIPTION => 'bs-dashboards-desc', EXTINFO::AUTHOR => 'Robert Vogel, Stephan Muggli', EXTINFO::VERSION => 'default', EXTINFO::STATUS => 'default', EXTINFO::PACKAGE => 'default', EXTINFO::URL => 'http://www.hallowelt.biz', EXTINFO::DEPS => array('bluespice' => '2.22.0')); $this->mExtensionKey = 'MW::Dashboards'; WikiAdmin::registerModuleClass('SpecialAdminDashboard', array('image' => '/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_dashboard_v1.png', 'level' => 'wikiadmin', 'message' => 'bs-specialadmindashboard-label')); wfProfileOut('BS::' . __METHOD__); }
public function __construct() { wfProfileIn('BS::' . __METHOD__); // Base settings $this->mExtensionFile = __FILE__; $this->mExtensionType = EXTTYPE::VARIABLE; $this->mInfo = array(EXTINFO::NAME => 'UserManager', EXTINFO::DESCRIPTION => 'bs-usermanager-desc', EXTINFO::AUTHOR => 'Markus Glaser, Stephan Muggli', EXTINFO::VERSION => 'default', EXTINFO::STATUS => 'default', EXTINFO::PACKAGE => 'default', EXTINFO::URL => 'http://www.hallowelt.biz', EXTINFO::DEPS => array('bluespice' => '2.22.0')); WikiAdmin::registerModule('UserManager', array('image' => '/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_usermanagement_v1.png', 'level' => 'wikiadmin', 'message' => 'bs-usermanager-label')); wfProfileOut('BS::' . __METHOD__); }
/** * contructor of the BsPreferences class */ public function __construct() { wfProfileIn('BS::' . __METHOD__); // Base settings $this->mExtensionFile = __FILE__; $this->mExtensionType = EXTTYPE::SPECIALPAGE; $this->mInfo = array(EXTINFO::NAME => 'Preferences', EXTINFO::DESCRIPTION => 'bs-preferences-desc', EXTINFO::AUTHOR => 'Sebastian Ulbricht, Stephan Muggli', EXTINFO::VERSION => 'default', EXTINFO::STATUS => 'default', EXTINFO::PACKAGE => 'default', EXTINFO::URL => 'http://www.hallowelt.biz', EXTINFO::DEPS => array('bluespice' => '2.22.0')); WikiAdmin::registerModule('Preferences', array('image' => '/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_einstellungen_v1.png', 'level' => 'wikiadmin', 'message' => 'bs-preferences-label')); wfProfileOut('BS::' . __METHOD__); }
/** * Contructor of the Flexiskin class */ public function __construct() { wfProfileIn('BS::' . __METHOD__); $this->mExtensionFile = __FILE__; $this->mExtensionType = EXTTYPE::OTHER; $this->mInfo = array(EXTINFO::NAME => 'Flexiskin', EXTINFO::DESCRIPTION => 'bs-flexiskin-desc', EXTINFO::AUTHOR => 'Tobias Weichart', EXTINFO::VERSION => 'default', EXTINFO::STATUS => 'default', EXTINFO::PACKAGE => 'default', EXTINFO::URL => 'http://www.hallowelt.biz', EXTINFO::DEPS => array('bluespice' => '2.22.0')); $this->mExtensionKey = 'MW::Flexiskin'; WikiAdmin::registerModule('Flexiskin', array('image' => '/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_flexiskin_v1.png', 'level' => 'wikiadmin', 'message' => 'bs-flexiskin-label')); wfProfileOut('BS::' . __METHOD__); }
/** * constructor for GroupManager class */ public function __construct() { wfProfileIn('BS::' . __METHOD__); // Base settings $this->mExtensionFile = __FILE__; $this->mExtensionType = EXTTYPE::SPECIALPAGE; $this->mInfo = array(EXTINFO::NAME => 'GroupManager', EXTINFO::DESCRIPTION => 'bs-groupmanager-desc', EXTINFO::AUTHOR => 'Markus Glaser, Sebastian Ulbricht', EXTINFO::VERSION => 'default', EXTINFO::STATUS => 'default', EXTINFO::PACKAGE => 'default', EXTINFO::URL => 'http://www.hallowelt.biz', EXTINFO::DEPS => array('bluespice' => '2.22.0')); $this->mExtensionKey = 'MW::GroupManager'; WikiAdmin::registerModule('GroupManager', array('image' => '/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_gruppe_v1.png', 'level' => 'wikiadmin', 'message' => 'bs-groupmanager-label')); wfProfileOut('BS::' . __METHOD__); }
/** * Constructor of ExtendedSearch class */ public function __construct() { wfProfileIn('BS::' . __METHOD__); // Base settings $this->mExtensionFile = __FILE__; $this->mExtensionType = EXTTYPE::VARIABLE; //SPECIALPAGE/OTHER/VARIABLE/PARSERHOOK $this->mInfo = array(EXTINFO::NAME => 'ExtendedSearch', EXTINFO::DESCRIPTION => 'bs-extendedsearch-desc', EXTINFO::AUTHOR => 'Stephan Muggli, Mathias Scheer, Markus Glaser', EXTINFO::VERSION => 'default', EXTINFO::STATUS => 'default', EXTINFO::PACKAGE => 'default', EXTINFO::URL => 'http://www.hallowelt.biz', EXTINFO::DEPS => array('bluespice' => '2.22.0')); $this->mExtensionKey = 'MW::ExtendedSearch'; WikiAdmin::registerModuleClass('ExtendedSearchAdmin', array('image' => '/extensions/BlueSpiceExtensions/WikiAdmin/resources/images/bs-btn_suche_v1.png', 'level' => 'wikiadmin', 'message' => 'bs-extendedsearchadmin-label')); wfProfileOut('BS::' . __METHOD__); }
public function getForm() { global $wgScriptPath; $form = ''; $registeredModules = WikiAdmin::getRegisteredModules(); foreach ($registeredModules as $module => $params) { $title = SpecialPage::getTitleFor('WikiAdmin'); $url = $title->getLocalURL('mode=' . $module); // TODO SU (04.07.11 10:56): Gehört eigentlich in eine view. $form .= '<div class="bs-admincontrolbtn">'; $form .= '<a href="' . $url . '">'; $form .= '<img src="' . $wgScriptPath . $params['image'] . '" alt="' . $module . '" title="' . $module . '">'; $form .= '<div class="bs-admin-label">'; $form .= wfMessage($params['message'])->plain(); $form .= '</div>'; $form .= '</a>'; $form .= '</div>'; } return $form; }
/** * Sets parameters for more complex options in preferences * @param string $sAdapterName Name of the adapter, e.g. MW * @param BsConfig $oVariable Instance of variable * @return array Preferences options */ public function runPreferencePlugin($sAdapterName, $oVariable) { switch ($oVariable->getName()) { case 'ActivatedNamespaces': $aPrefs = array('type' => 'multiselectex', 'options' => BsNamespaceHelper::getNamespacesForSelectOptions(array(-2, -1))); break; case 'AutoPermissions': global $wgGroupPermissions; $aAvailablePermissions = array(); foreach ($wgGroupPermissions as $sGroup => $aPermissions) { foreach ($aPermissions as $sName => $bValue) { if (!in_array($sName, WikiAdmin::get('ExcludeRights'))) { $aAvailablePermissions[$sName] = $sName; } } } natsort($aAvailablePermissions); $aPrefs = array('type' => 'multiselectex', 'options' => array_unique($aAvailablePermissions)); break; } return $aPrefs; }
/** * Adds WikiAdmin tab to main navigation * @param SkinTemplate $sktemplate * @param BaseTemplate $tpl * @return boolean Always true to keep hook running */ public static function onSkinTemplateOutputPageBeforeExec(&$sktemplate, &$tpl) { if ($sktemplate->getUser()->isAllowed('wikiadmin') === false) { return true; } $oSpecialPage = SpecialPage::getTitleFor('WikiAdmin'); $aRegisteredModules = WikiAdmin::getRegisteredModules(); $aOutSortable = array(); $aOut = array(); $aOut[] = '<ul>'; foreach ($aRegisteredModules as $sModuleKey => $aModulParams) { $skeyLower = mb_strtolower($sModuleKey); $sModulLabel = wfMessage('bs-' . $skeyLower . '-label')->plain(); $sUrl = $oSpecialPage->getLocalURL(array('mode' => $sModuleKey)); //$sUrl = str_replace( '&', '&', $sUrl ); $sLink = Html::element('a', array('id' => 'bs-admin-' . $skeyLower, 'href' => $sUrl, 'title' => $sModulLabel), $sModulLabel); $aOutSortable[$sModulLabel] = '<li>' . $sLink . '</li>'; } $aOutSortable['Shop'] = self::getShopListItem(); $aOutSortable['SpecialPages'] = self::getMediaWikiSpecialPageItem(); ksort($aOutSortable); $aOut[] = implode("\n", $aOutSortable) . '</ul>'; $aOut[] = '</ul>'; if ($tpl instanceof BsBaseTemplate) { $tpl->data['bs_navigation_main']['bs-wikiadmin'] = array('position' => 100, 'label' => wfMessage('bs-tab_admin')->plain(), 'class' => 'icon-cog', 'content' => implode("\n", $aOut)); } else { $tpl->data['sidebar'][wfMessage('bs-tab_admin')->plain()] = implode("\n", $aOut); } return true; }
function get_edit_form($showheader = false) { global $post, $wp_version, $edit_post, $post_id, $post_ID; if ($showheader) { echo '<div class="incsub_wiki incsub_wiki_single">'; echo '<div class="incsub_wiki_tabs incsub_wiki_tabs_top">' . $this->tabs() . '<div class="incsub_wiki_clear"></div></div>'; } echo '<h3>' . __('Edit', $this->translation_domain) . '</h3>'; echo '<form action="' . get_permalink() . '" method="post">'; if (isset($_REQUEST['eaction']) && $_REQUEST['eaction'] == 'create') { $edit_post = $this->get_default_post_to_edit($post->post_type, true, $post->ID); echo '<input type="hidden" name="parent_id" id="parent_id" value="' . $post->ID . '" />'; echo '<input type="hidden" name="original_publish" id="original_publish" value="Publish" />'; echo '<input type="hidden" name="publish" id="publish" value="Publish" />'; } else { $edit_post = $post; echo '<input type="hidden" name="parent_id" id="parent_id" value="' . $edit_post->post_parent . '" />'; echo '<input type="hidden" name="original_publish" id="original_publish" value="Update" />'; } $post_id = $edit_post->ID; $post_ID = $post_id; echo '<input type="hidden" name="post_type" id="post_type" value="' . $edit_post->post_type . '" />'; echo '<input type="hidden" name="post_ID" id="wiki_id" value="' . $edit_post->ID . '" />'; echo '<input type="hidden" name="post_status" id="wiki_id" value="published" />'; echo '<input type="hidden" name="comment_status" id="comment_status" value="open" />'; echo '<input type="hidden" name="action" id="wiki_action" value="editpost" />'; echo '<div><input type="text" name="post_title" id="wiki_title" value="' . $edit_post->post_title . '" class="incsub_wiki_title" size="30" /></div>'; echo '<div>'; if (version_compare($wp_version, "3.3") >= 0) { wp_editor($edit_post->post_content, 'wikicontent', array('textarea_name' => 'content', 'wpautop' => false)); } else { echo '<textarea tabindex="2" name="content" id="wikicontent" class="incusb_wiki_tinymce" cols="40" rows="10" >' . $edit_post->post_content . '</textarea>'; } echo '</div>'; echo '<input type="hidden" name="_wpnonce" id="_wpnonce" value="' . wp_create_nonce("wiki-editpost_{$edit_post->ID}") . '" />'; if (is_user_logged_in()) { echo $this->get_meta_form(); } echo '<div class="incsub_wiki_clear">'; echo '<input type="submit" name="save" id="btn_save" value="' . __('Save', $this->translation_domain) . '" /> '; echo '<a href="' . get_permalink() . '">' . __('Cancel', $this->translation_domain) . '</a>'; echo '</div>'; echo '</form>'; if ($showheader) { echo '</div>'; } if (version_compare($wp_version, "3.3") < 0) { require_once 'lib/classes/WikiAdmin.php'; $wiki_admin = new WikiAdmin(); $wiki_admin->tiny_mce(true, array("editor_selector" => "incusb_wiki_tinymce")); } echo '<style type="text/css">' . '#comments { display: none; }' . '.comments { display: none; }' . '</style>'; return ''; }