function template_common_epilogue($args)
{
    global $FindScript, $pagestore, $PrefsScript, $AdminScript;
    //echo "<p>template_common_epilogue(".print_r($args,True).")</p>";
    ?>
<div id="footer">
<hr align=left width=99% />
<?php 
    if (!$args['nosearch']) {
        ?>
	
    <form method="POST" action="<?php 
        print $FindScript;
        ?>
" name="thesearch">
      <div class="form">
        <input type="hidden" name="action" value="find" />
<?php 
    }
    if ($args['edit']) {
        if ($args['editver'] == 0) {
            echo '<a href="' . editURL($args['edit']) . '">' . lang('Edit this document') . '</a>';
        } else {
            if ($args['editver'] == -1) {
                echo lang('This page can not be edited.');
            } else {
                echo '<a href="' . editURL($args['edit'], $args['editver']) . '">' . lang('Edit this <em>ARCHIVE VERSION</em> of this document') . '</a>';
            }
        }
        if ($args['history']) {
            print ' | ';
        }
    }
    if ($args['history']) {
        echo '<a href="' . historyURL($args['history']) . '">' . lang('View document history') . '</a>';
        echo ' | <a href="' . $PrefsScript . '">' . lang('Preferences') . '</a>';
        if (!$args['nosearch']) {
            echo '| ' . lang('Search') . ': <input type="text" name="find" size="20" />';
        }
        echo "<br />";
    }
    if ($args['timestamp']) {
        echo lang('Document last modified') . ' ' . html_time($args['timestamp']) . '<br />';
    }
    ?>
      </div>
    </form>
<?php 
    if ($args['twin'] != '') {
        if (count($twin = $pagestore->twinpages($args['twin']))) {
            echo lang('Twin pages') . ': ';
            for ($i = 0; $i < count($twin); $i++) {
                print html_twin($twin[$i][0], $twin[$i][1]) . ' ';
            }
            ?>
<br /><?php 
        }
    }
    if (!$args['nosearch'] && $args['history']) {
        echo "\n<hr align=left width=99% />\n";
    }
    ?>
</div>
<?php 
    //</body>
    //</html>
    /*
      $size = ob_get_length();
      ##header("Content-Length: $size");
      ob_end_flush();
    */
}
Example #2
0
 public function sendEmail($to, $letter, $data = array())
 {
     if (is_array($to)) {
         if (empty($to['email'])) {
             return false;
         }
         if (empty($to['name'])) {
             $to['name'] = false;
         }
     } else {
         if (empty($to)) {
             return false;
         }
         $to = array('email' => $to, 'name' => false);
     }
     if (is_array($letter)) {
         if (empty($letter['text'])) {
             $letter['text'] = cmsCore::getLanguageTextFile("letters/{$letter['name']}");
         }
     } else {
         $letter = array('text' => cmsCore::getLanguageTextFile("letters/{$letter}"));
     }
     if (!$letter['text']) {
         return false;
     }
     $config = cmsConfig::getInstance();
     $data = array_merge(array('site' => $config->sitename, 'date' => html_date(time()), 'time' => html_time(time())), $data);
     $letter['text'] = string_replace_keys_values($letter['text'], $data);
     $mailer = new cmsMailer();
     $mailer->addTo($to['email'], $to['name']);
     $letter['text'] = $mailer->parseSubject($letter['text']);
     $letter['text'] = $mailer->parseAttachments($letter['text']);
     $mailer->setBodyHTML(nl2br($letter['text']));
     $result = $mailer->send();
     $mailer->clearTo()->clearAttachments();
     return $result;
 }
Example #3
0
function template_common_epilogue($args)
{
    global $AdditionalFooter, $AllowAnonymousPosts, $EmailSuffix;
    global $EnableSubscriptions, $EnableCaptcha, $HomePage, $NickName, $page;
    global $pagestore, $PageTooLongLen, $PrefsScript, $UserName;
    $pg = $pagestore->page($page);
    $pagetext = $pg->text;
    if (isset($args["toolbar"])) {
        ?>
   <div class="toolbar" id="toolbar-bottom"><?php 
        toolbar($page, $args);
        ?>
</div>
  <?php 
    }
    ?>
</div>
	
	
<NOINDEX>
<div id="footer" class="printhide">
	
<div id="logininfo">
<?php 
    if ($UserName) {
        print "Logged in as " . html_ref($UserName, $UserName);
    } else {
        print "Not <a href=\"login/?{$page}\">logged in</a>";
    }
    if ($EnableSubscriptions && isset($EmailSuffix) && $UserName != '' && isset($args['subscribe']) && !empty($args['subscribe'])) {
        if ($pg->isSubscribed($UserName)) {
            $caption = 'Unsubscribe';
        } else {
            $caption = 'Subscribe';
        }
        print ' | <a href="' . pageSubscribeURL($args['subscribe']) . '">' . $caption . '</a>';
    }
    if (!$UserName) {
        print ' | <a href="' . viewURL($page) . '&view_source=1">View source</a>';
    }
    print "<br>";
    print html_ref('RecentChanges', 'RecentChanges') . ', ' . '<a href="' . $PrefsScript . '">UserOptions</a>';
    $help_page = $pagestore->page('HelpPage');
    if ($help_page->exists()) {
        print ', ' . html_ref('HelpPage', 'HelpPage');
    }
    ?>
</div>
	
<div id="comment">
<?php 
    if (!in_array($page, array($HomePage, 'RecentChanges')) && ($UserName || $AllowAnonymousPosts)) {
        ?>
    <script language="javascript">
    <!--
    function epilogue_quickadd_validate(form)
    {
        if (form.quickadd.value == '') {
            alert('Please provide content for the text field.');
            return false;
        } else if (form.validationcode && form.validationcode.value == '') {
            alert('The validation code is required.');
            return false;
        } else {
            return true;
        }
    }
    //-->
    </script>

    <?php 
        if ($args['edit']) {
            if ($args['page_length'] > $PageTooLongLen) {
                print '<div style="color:red;font-weight:bold">' . 'This page is too long. Comments are disabled.</div>';
            } else {
                global $document;
                $document = $pg->read();
                $document = str_replace('"', "\\\\'", $document);
                ?>
            <form method="post" action="<?php 
                print saveURL($page);
                ?>
">
            <div class="form">
            <input type="hidden" name="Save" value="1">
            <input type="hidden" name="appending" value="1">
            <?php 
                if (!strcasecmp($page, 'annoyingquote') || !strcasecmp($page, 'accumulatedwisdom')) {
                    // Tweaked "Add a Comment" for AnnoyingQuote page
                    ?>
                <input type="hidden" name="comment" value="Add a Quote">
                <input type="hidden" name="appendingQuote" value="1">
                <table width="100%">
                <tr valign="bottom">
                <td align="right">Quote:&nbsp;</td>
                <td nowrap><textarea name="quickadd" rows="2" wrap="virtual"></textarea></td>
                </tr>
                <tr valign="bottom">
                <td width="1%" align="right">Author:&nbsp;</td>
                <td width="99%" nowrap><input class="fullWidth" type="text" name="quoteAuthor" size="20" value=""></td>
                </tr>
                </table>
                <?php 
                    if (!$UserName && $EnableCaptcha) {
                        print_captcha_box();
                    }
                    ?>
                <input type="submit" name="append" value="Add a Quote" onClick="return epilogue_quickadd_validate(this.form)">
                <?php 
                } else {
                    // Standard Add a Comment
                    print '<input type="hidden" name="comment" value="Comment">';
                    print '<textarea name="quickadd" rows="4" cols="20">';
                    print "----\n'''";
                    if ($UserName) {
                        print "[{$UserName}]";
                    } else {
                        if ($NickName) {
                            print htmlspecialchars($NickName);
                        } else {
                            print "Anonymous@" . $_SERVER["REMOTE_ADDR"];
                        }
                    }
                    print " (" . date('Y/m/d') . ")''': ";
                    print "</textarea>\n";
                    if (!$UserName) {
                        if ($EnableCaptcha) {
                            print_captcha_box();
                        }
                        if (!$NickName) {
                            print '(Anonymous users, see <a href="' . $PrefsScript . '">UserOptions</a> to set a nickname.)&nbsp;';
                        }
                    }
                    print '<input type="submit" name="append" value="Add a Comment" onClick="return epilogue_quickadd_validate(this.form)">';
                }
                ?>
            </div>
            </form>
            <?php 
            }
        }
        ?>

<?php 
    }
    ?>
	
</div>
	
<div id="timestamp">
<?php 
    if (isset($args['timestamp'])) {
        print '<i>Last edited ' . html_time($args['timestamp']);
        if ($args['timestamp'] != '') {
            if (isset($args['euser']) && $args['euser']) {
                print ' by ' . $args['euser'];
            } else {
                print ' anonymously';
            }
        }
    }
    if (isset($args['twin']) && $args['twin'] != '') {
        if (count($twin = $pagestore->twinpages($args['twin']))) {
            print '<br>See twins of this page: ';
            for ($i = 0; $i < count($twin); $i++) {
                print html_twin($twin[$i][0], $twin[$i][1]) . ' ';
            }
        }
    }
    ?>
</div>

<?php 
    if ($AdditionalFooter) {
        include $AdditionalFooter;
    }
    ?>
</div>
</NOINDEX>
</body>
</html>

<?php 
}
Example #4
0
function html_history_entry($page, $version, $time, $host, $user, $c1, $c2, $comment)
{
    return "<tr><td>" . "<input type=\"radio\" name=\"ver1\" value=\"{$version}\"" . ($c1 ? ' checked="checked"' : '') . " /></td>\n" . "    <td>" . "<input type=\"radio\" name=\"ver2\" value=\"{$version}\"" . ($c2 ? ' checked="checked"' : '') . " /></td>\n" . "<td><a href=\"" . viewURL($page, $version) . "\">" . html_time($time) . "</a> . . . . " . ($user == '' ? $host : html_ref($user, $user, $host)) . ($comment == '' ? '' : ' ' . html_bold_start() . '[' . str_replace('<', '&lt;', str_replace('&', '&amp;', $comment)) . ']' . html_bold_end()) . "</td></tr>\n";
}
Example #5
0
function hTime($time)
{
    return html_time($time);
}
Example #6
0
function template_common_epilogue($args)
{
    global $FindScript, $pagestore;
    ?>
<div id="footer">
<hr />
<div id="toolbar-bottom">
<?php 
    if ($args['edit']) {
        if ($args['editver'] == 0) {
            echo '<a href="' . editUrl($args['edit']) . '">' . TMPL_EditDocument . '</a>';
        } else {
            if ($args['editver'] == -1) {
                echo TMPL_NoEditDocument;
            } else {
                echo '<a href="' . editUrl($args['edit'], $args['editver']) . '">' . TMPL_EditArchiveVersion . '</a>';
            }
        }
        if ($args['history']) {
            print ' | ';
        }
    }
    if ($args['history']) {
        echo '<a href="' . historyURL($args['history']) . '">' . TMPL_ViewDocHistory . '</a><br />';
    }
    if ($args['timestamp']) {
        echo "\n</div>\n" . TMPL_DocLastModified . ' ' . html_time($args['timestamp']) . '<br />';
    }
    if ($args['twin'] != '') {
        if (count($twin = $pagestore->twinpages($args['twin']))) {
            echo TMPL_TwinPages . ' ';
            for ($i = 0; $i < count($twin); $i++) {
                print html_twin($twin[$i][0], $twin[$i][1]) . ' <br />';
            }
        }
    }
    if (!$args['nosearch']) {
        ?>
<form method="get" action="<?php 
        print $FindScript;
        ?>
">
<div class="form">
  <input type="hidden" name="action" value="find" />
  <?php 
        print TMPL_Search;
        ?>
 <input type="text" name="find" size="20" />
</div>
</form>
<?php 
    }
    ?>
</div>
<!-- Commented out since this is done via Group-Office framework
</body>
</html>
-->
<?php 
    // Following three lines are commented out since this is done via Group-Office framework
    //  $size = ob_get_length();
    //  header("Content-Length: $size");
    //  ob_end_flush();
}
Example #7
0
    echo $message['id'];
    ?>
">
            <div class="title">
                <span class="author"><?php 
    echo $message['user']['nickname'];
    ?>
</span>
                <span class="date<?php 
    if ($message['is_new']) {
        ?>
-new<?php 
    }
    ?>
"><?php 
    echo $is_today ? html_time($message['date_pub']) : html_date_time($message['date_pub']);
    ?>
</span>
            </div>
            <div class="message_text"><?php 
    echo $message['content'];
    ?>
</div>
        </div>
    </div>

<?php 
}
?>
<script type="text/javascript">
    icms.messages.setMsgLastDate('<?php