Esempio n. 1
0
/**
 * Setup for WikiaBar - Meebo replacement
 * @author Andrzej 'nAndy' Łukaszewski
 * @author Marcin Maciejewski
 * @author Sebastian Marzjan
 */
$dir = dirname(__FILE__) . '/';
$wgExtensionCredits['other'][] = array('name' => 'WikiaBar', 'author' => array('Andrzej \'nAndy\' Łukaszewski', 'Marcin Maciejewski', 'Sebastian Marzjan'), 'descriptionmsg' => 'wikiabar-desc', 'url' => 'https://github.com/Wikia/app/tree/dev/extensions/wikia/WikiaBar');
/**
 * classes
 */
$wgAutoloadClasses['WikiaBarController'] = $dir . 'WikiaBarController.class.php';
$wgAutoloadClasses['WikiaBarHooks'] = $dir . 'WikiaBarHooks.class.php';
$wgAutoloadClasses['WikiaBarModel'] = $dir . 'models/WikiaBarModel.class.php';
$wgAutoloadClasses['WikiaBarModelBase'] = $dir . 'models/WikiaBarModelBase.class.php';
$wgAutoloadClasses['WikiaBarDataModel'] = $dir . 'models/WikiaBarDataModel.class.php';
$wgAutoloadClasses['WikiaBarDataFailsafeModel'] = $dir . 'models/WikiaBarDataFailsafeModel.class.php';
$wgAutoloadClasses['WikiaBarDataValidator'] = $dir . 'models/WikiaBarDataValidator.class.php';
$wgAutoloadClasses['WikiaBarMessageDataValidator'] = $dir . 'models/WikiaBarMessageDataValidator.class.php';
$wgAutoloadClasses['WikiaBarFailsafeDataValidator'] = $dir . 'models/WikiaBarFailsafeDataValidator.class.php';
$wgAutoloadClasses['WikiaBarUserPropertiesHandler'] = $dir . 'models/WikiaBarUserPropertiesHandler.class.php';
WikiaUserPropertiesController::registerHandler('WikiaBarUserPropertiesHandler');
/**
 * hooks
 */
$wgHooks['MakeGlobalVariablesScript'][] = 'WikiaBarHooks::onMakeGlobalVariablesScript';
$wgHooks['WikiFactoryChanged'][] = 'WikiaBarHooks::onWikiFactoryVarChanged';
$wgHooks['WikiFactoryVarSave::AfterErrorDetection'][] = 'WikiaBarHooks::onWFAfterErrorDetection';
// i18n mapping
$wgExtensionMessagesFiles['WikiaBar'] = $dir . 'WikiaBar.i18n.php';
Esempio n. 2
0
$wgAutoloadClasses['EditPageService'] = $dir . '/EditPageService.class.php';
// abstract special page class for custom edit pages
$wgAutoloadClasses['SpecialCustomEditPage'] = $dir . '/SpecialCustomEditPage.class.php';
// hooks
$wgHooks['AlternateEditPageClass'][] = 'EditPageLayoutHooks::onAlternateEditPageClass';
$wgHooks['EditPageBeforeConflictDiff'][] = 'EditPageLayoutHooks::onEditPageBeforeConflictDiff';
$wgHooks['EditPageGetPreviewNote'][] = 'EditPageLayoutHooks::onEditPageGetPreviewNote';
$wgHooks['EditForm:AfterDisplayingTextbox'][] = 'EditPageLayoutHooks::onAfterDisplayingTextbox';
$wgHooks['EditForm:BeforeDisplayingTextbox'][] = 'EditPageLayoutHooks::onBeforeDisplayingTextbox';
$wgHooks['GetPreferences'][] = 'EditPageLayoutHooks::onGetPreferences';
$wgHooks['LogEventsListShowLogExtract'][] = 'EditPageLayoutHooks::onLogEventsListShowLogExtract';
// messages
$wgExtensionMessagesFiles['EditPageLayout'] = $dir . '/EditPageLayout.i18n.php';
// add class to autoloader and register handler for it
$wgAutoloadClasses['EditorUserPropertiesHandler'] = "{$dir}/models/EditorUserPropertiesHandler.class.php";
WikiaUserPropertiesController::registerHandler('EditorUserPropertiesHandler');
// register messages package for JS
JSMessages::registerPackage('EditPageLayout', array('ok', 'back', 'preview', 'savearticle', 'editpagelayout-captcha-title', 'editpagelayout-edit-info', 'editpagelayout-more', 'editpagelayout-less', 'editpagelayout-pageControls-changes', 'editpagelayout-preview-label-desktop', 'editpagelayout-preview-label-mobile', 'editpagelayout-loadingStates-*', 'editpagelayout-modules-*', 'wikia-editor-*', 'restore-edits-*', 'plb-special-form-cat-info', 'wikia-editor-preview-current-width', 'wikia-editor-preview-min-width', 'wikia-editor-preview-max-width', 'wikia-editor-preview-type-tooltip'));
// Ajax dispatcher
$wgAjaxExportList[] = 'EditPageLayoutAjax';
function EditPageLayoutAjax()
{
    global $wgRequest;
    wfProfileIn(__METHOD__);
    $ret = false;
    $method = $wgRequest->getVal('method', false);
    if ($method && method_exists('EditPageLayoutAjax', $method)) {
        $data = EditPageLayoutAjax::$method();
        if (is_array($data)) {
            $json = json_encode($data);
            $response = new AjaxResponse($json);