public static function onWFAfterErrorDetection($cv_id, $city_id, $cv_name, $cv_value, &$return, &$error)
 {
     if (self::isWikiaBarConfig($city_id, $cv_name)) {
         /* @var $validator WikiaBarMessageDataValidator */
         $validator = F::build('WikiaBarMessageDataValidator');
         /* @var $model WikiaBarModel */
         $model = F::build('WikiaBarModel');
         $errorCount = 0;
         $errors = array();
         if (is_array($cv_value)) {
             foreach ($cv_value as $vertical => $languages) {
                 foreach ($languages as $language => $content) {
                     $validator->clearErrors();
                     $model->parseBarConfigurationMessage(trim($content), $validator);
                     $messageErrorCount = $validator->getErrorCount();
                     if ($messageErrorCount) {
                         $errorMessages = $validator->getErrors();
                         foreach ($errorMessages as &$errorMessage) {
                             $errorMessage = Wikia::errormsg('vertical: ' . $vertical . ', language: ' . $language . ' : ' . $errorMessage);
                         }
                         $errors = array_merge($errors, $errorMessages);
                         $errorCount += $messageErrorCount;
                     }
                 }
             }
         }
         if ($errorCount) {
             $error = $errorCount;
             $return = trim(implode("<br/>", $errors));
         }
     }
     return true;
 }
 function index()
 {
     if (!$this->wg->User->isAllowed('usermanagement')) {
         $this->skipRendering();
         throw new PermissionsError('usermanagement');
     }
     $this->setHeaders();
     $par = $this->getPar();
     $this->mUser = User::newFromName($par);
     $this->editCount = $this->mUser->getEditCount();
     $this->wikisEdited = '(coming soon)';
     $this->firstEdit = $this->wg->Lang->date($this->mUser->getFirstEditTimestamp());
     $this->lastEdit = $this->wg->Lang->date($this->mUser->getTouched());
     $this->email = $this->mUser->getEmail();
     $this->emailConfirmationDate = $this->wg->Lang->date($this->mUser->getEmailAuthenticationTimestamp());
     $this->emailSubscriptionStatus = !$this->mUser->getOption('unsubscribed', 0);
     // email delivery info
     $emailErrors = array();
     $lastEmailData = $this->getLastEmailDelivery();
     if (empty($lastEmailData)) {
         $this->emailLastDelivery = 'none';
     } else {
         $this->emailLastDelivery = $this->wg->Lang->date(wfTimestamp(TS_MW, $lastEmailData['transmitted']));
         /*
         			if ( $lastEmailData['is_bounce'] ) {
         				$this->emailError[] = "bounced";
         			}
         
         			if ( $lastEmailData['is_error'] ) {
         				$this->emailErrors[] = "error (" . $lastEmailData['error_status'] . "): " . $lastEmailData['error_msg'];
         			}
         
         			if ( $lastEmailData['is_spam'] ) {
         				$this->emailErrors[] = "marked as spam";
         			}
         */
         if (empty($emailErrors)) {
             $this->emailLastDeliveryStatus = '';
             // Wikia::successmsg( 'OK' );
         } else {
             $this->emailLastDeliveryStatus = Wikia::errormsg(implode(', ', $emailErrors));
         }
     }
     $this->emailChangeUrl = GlobalTitle::newFromText('EditAccount', NS_SPECIAL, 177)->getFullUrl() . '/' . $par;
     $this->emailChangeSubscriptionUrl = $this->emailChangeUrl;
 }
?>
</a> <a href="<?php 
echo $emailChangeUrl;
?>
" class="wikia-button secondary">change email</a></dd>

	<dt>Email confirmation date</dt>
	<dd><?php 
echo $emailConfirmationDate;
?>
</dd>

	<dt>Subscription status</dt>
	<dd>
		<?php 
echo $emailSubscriptionStatus ? Wikia::successmsg('subscribed') : Wikia::errormsg('not subscribed');
?>
		<?php 
if (!$emailSubscriptionStatus) {
    ?>
<a href="<?php 
    echo $emailChangeSubscriptionUrl;
    ?>
" class="wikia-button secondary">re-subscribe</a><?php 
}
?>
	</dd>

	<dt>Last email delivery</dt>
	<dd><?php 
echo $emailLastDelivery;
/**
 * axWFactoryRemoveVariable
 *
 * Ajax call, remove
 *
 * @access public
 * @author eloy@wikia
 *
 * @return string: json string with array of variables
 */
function axWFactoryRemoveVariable()
{
    global $wgUser, $wgRequest;
    $error = 0;
    $return = "";
    if (!$wgUser->isAllowed('wikifactory')) {
        $error++;
        $return = Wikia::errormsg("You are not allowed to change variable value");
    } else {
        $cv_id = $wgRequest->getVal('varId');
        $city_id = $wgRequest->getVal('cityid');
        $tag_name = $wgRequest->getVal('tagName');
        $tag_wiki_count = 0;
        $form_id = $wgRequest->getVal("formId", null);
        $reason = $wgRequest->getVal("reason", null);
        if (!WikiFactory::removeVarById($cv_id, $city_id, $reason)) {
            $error++;
            $return = Wikia::errormsg("Variable not removed because of problems with database. Try again.");
        } else {
            $return = Wikia::successmsg(" Value of variable was removed ");
            if (!empty($tag_name)) {
                // apply changes to all wikis with given tag
                $tagsQuery = new WikiFactoryTagsQuery($tag_name);
                foreach ($tagsQuery->doQuery() as $tagged_wiki_id) {
                    if (WikiFactory::removeVarByID($cv_id, $tagged_wiki_id)) {
                        $tag_wiki_count++;
                    }
                }
                $return .= Wikia::successmsg(" ({$tag_wiki_count} wikis affected)");
            }
        }
    }
    if (empty($form_id)) {
        $div_name = "wf-variable-parse";
    } else {
        $div_name = "wf-variable-parse-{$form_id}";
    }
    return json_encode(array("div-body" => $return, "is-error" => $error, "tag-name" => $tag_name, "tag-wikis" => $tag_wiki_count, "div-name" => $div_name));
}
Example #5
0
?>
</small>
<?php 
if (!is_null($status)) {
    ?>
<fieldset>
	<legend><?php 
    echo wfMessage('editaccount-status')->escaped();
    ?>
</legend>
	<?php 
    echo $status ? Wikia::successmsg($statusMsg) : Wikia::errormsg($statusMsg);
    ?>
	<?php 
    if (!empty($statusMsg2)) {
        echo Wikia::errormsg($statusMsg2);
    }
    ?>
</fieldset>
<?php 
}
?>
<fieldset>
	<legend><?php 
echo wfMessage('editaccount-frame-account', $user)->escaped();
?>
</legend>
	<?php 
echo $userEncoded;
?>
<br />
Example #6
0
<!-- s:<?php 
echo __FILE__;
?>
 -->
<?php 
if (!is_null($status)) {
    ?>
<fieldset>
	<legend><?php 
    echo wfMessage('editaccount-status')->escaped();
    ?>
</legend>
	<?php 
    echo $status ? Wikia::successmsg($statusMsg) : Wikia::errormsg($statusMsg);
    ?>
</fieldset>
<?php 
}
?>
<form method="post" id="editaccountSelectForm" class="EditAccountForm" action="">
	<fieldset>
		<legend><?php 
echo wfMessage('editaccount-frame-close', $user)->escaped();
?>
</legend>
		<p><?php 
echo wfMessage('editaccount-warning-close', $user)->parse();
?>
</p>
		<div class="input-group">
			<label for="wpReason"><?php 
Example #7
0
		<div id="WikiTextPreview">
			<?php 
echo empty($formData['messagePreview']) ? '' : $formData['messagePreview'];
?>
		</div>
	</fieldset>
</div>

<div id="PaneCompose">
	<fieldset>
		<legend><?php 
echo wfMsg('swm-label-edit');
?>
</legend>
		<div id="PaneError"><?php 
echo isset($formData['errMsg']) ? Wikia::errormsg($formData['errMsg']) : '';
?>
</div>
		<form method="post" id="msgForm" action="<?php 
echo $title->getLocalUrl();
?>
">
			<input type="hidden" name="editMsgId" value="<?php 
echo $editMsgId;
?>
" />
			<?php 
if (!$editMsgId) {
    ?>
			<fieldset>
				<legend><?php 
Example #8
0
<!-- s:<?php 
echo __FILE__;
?>
 -->
<div id="PaneCompose">
	<div id="PaneError">
		<?php 
echo !empty($err) ? Wikia::errormsg($err) : '';
?>
	</div>
	<div id="PaneInfo">
		<?php 
echo wfMsg('multiwikiedit_help');
?>
	</div>
	<form name="multiwikiedit" class="highlightform" id="highlightform" enctype="multipart/form-data" method="post" action="<?php 
echo htmlspecialchars($obj->mTitle->getLocalURL("action=submit"));
?>
">
	<table>
		<tr>
			<td align="right"><?php 
echo wfMsg('multiwikiedit_as');
?>
 :</td>
			<td align="left">
				<select tabindex="1" name="wpMode" id="wpMode">
					<option value="script" <?php 
echo $obj->mMode == 'script' ? 'selected="selected"' : '';
?>
 > <?php