コード例 #1
0
echo '<td><a href="admin/massmail/details/' . $this->id . '/sent">' . $massmail->Sent . '</a></td>';
echo '<td><a href="admin/massmail/details/' . $this->id . '/failed">' . $massmail->Failed . '</a></td></tr>';
if (!$this->detail) {
    echo '<tr class="highlight"><td class="left" colspan="5"><strong>' . $words->get('AdminMassMailAvailableLanguages') . '</strong>:';
    $lang = $_SESSION['lang'];
    foreach ($massmail->Languages as $language) {
        if ($language->ShortCode == $lang) {
            echo '<strong>';
        }
        echo " " . $language->Name;
        if ($language->ShortCode == $lang) {
            echo '</strong>';
        }
    }
    $purifier = MOD_htmlpure::getAdvancedHtmlPurifier();
    echo '<tr class="blank"><td class="left" colspan="5"><strong>' . $words->get('AdminMassMailSubject') . '</strong>: ' . str_replace("%username%", "Username", $words->getAsIs('BroadCast_Title_' . $massmail->Name)) . '</td></tr>';
    echo '<tr class="blank"><td class="left" colspan="5"><strong>' . $words->get('AdminMassMailBody') . '</strong>:<br />' . str_replace("%username%", "Username", nl2br($words->getAsIs('BroadCast_Body_' . $massmail->Name))) . '</td></tr>';
    echo '</table>';
} else {
    echo '<tr class="highlight"><td class="left" colspan="5"><strong>' . $words->get('AdminMassMailDetailsStatus') . ':</strong> ' . $words->get('AdminMassMail' . $this->type) . '</td></tr>';
    echo '<tr class="blank"><td class="left" colspan="5">' . $words->get('AdminMassMailShowRecipients', $this->ROWSPERPAGE) . '</td></tr>';
    echo '</table>';
    echo $this->detail;
    $params = new StdClass();
    $params->strategy = new HalfPagePager('right');
    $params->page_url = 'admin/massmail/details/' . $this->id . '/' . $this->detail;
    echo $params->page_url;
    $params->page_url_marker = 'page';
    $params->page_method = 'url';
    $params->items = $this->count;
    $params->active_page = $this->pageno;
コード例 #2
0
 public function massmailEditCreateVarsOk(&$vars)
 {
     $id = $vars['Id'];
     $name = $vars['Name'];
     $subject = $vars['Subject'];
     $body = $vars['Body'];
     $description = $vars['Description'];
     $type = $vars['Type'];
     $errors = array();
     if (empty($name)) {
         $errors[] = 'AdminMassMailNameEmpty';
     }
     if (empty($subject)) {
         $errors[] = 'AdminMassMailSubjectEmpty';
     }
     if (empty($body)) {
         $errors[] = 'AdminMassMailBodyEmpty';
     }
     if (empty($description)) {
         $errors[] = 'AdminMassMailDescriptionEmpty';
     }
     if ($type == "None") {
         $errors[] = 'AdminMassMailChooseAType';
     }
     // if $id = 0 check if a word code for $name already exists
     if ($id == 0) {
         $words = new MOD_words();
         $subject = 'BroadCast_Title_' . $name;
         $body = 'BroadCast_Body_' . $name;
         $subjectCode = $words->getAsIs($subject);
         $bodyCode = $words->getAsIs($body);
         if (!($subject == $subjectCode) || !($body == $bodyCode)) {
             $errors[] = 'AdminMassMailCodeExists';
         }
     }
     return $errors;
 }