Esempio n. 1
0
 private function postLine()
 {
     $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
     switch ($this->rs->post_status) {
         case 1:
             $img_status = sprintf($img, __('published'), 'check-on.png');
             break;
         case 0:
             $img_status = sprintf($img, __('unpublished'), 'check-off.png');
             break;
         case -1:
             $img_status = sprintf($img, __('scheduled'), 'scheduled.png');
             break;
         case -2:
             $img_status = sprintf($img, __('pending'), 'check-wrn.png');
             break;
     }
     $protected = '';
     if ($this->rs->post_password) {
         $protected = sprintf($img, __('protected'), 'locker.png');
     }
     $selected = '';
     if ($this->rs->post_selected) {
         $selected = sprintf($img, __('selected'), 'selected.png');
     }
     $attach = '';
     $nb_media = $this->rs->countMedia();
     if ($nb_media > 0) {
         $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments');
         $attach = sprintf($img, sprintf($attach_str, $nb_media), 'attach.png');
     }
     $res = '<tr class="line' . ($this->rs->post_status != 1 ? ' offline' : '') . '"' . ' id="p' . $this->rs->post_id . '">';
     $res .= '<td class="nowrap">' . form::checkbox(array('entries[]'), $this->rs->post_id, '', '', '', !$this->rs->isEditable()) . '</td>' . '<td class="maximal"><a href="' . $this->core->getPostAdminURL($this->rs->post_type, $this->rs->post_id) . '">' . html::escapeHTML($this->rs->post_title) . '</a></td>' . '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->post_dt) . '</td>' . '<td class="nowrap">' . $this->rs->user_id . '</td>' . '<td class="nowrap">' . $this->rs->nb_comment . '</td>' . '<td class="nowrap">' . $this->rs->nb_trackback . '</td>' . '<td class="nowrap status">' . $img_status . ' ' . $selected . ' ' . $protected . ' ' . $attach . '</td>' . '</tr>';
     return $res;
 }
Esempio n. 2
0
 function edit()
 {
     events::observe('save', 'templates', 'apps', '_save');
     events::observer();
     $tmpl_file = events::get('tmpl_file');
     $app = events::get('app');
     if (events::detect('restore')) {
         self::restoreVersion($app, $tmpl_file, events::get('restore'));
     }
     admin::components('tabs', 'validator');
     f::set('app', $app);
     f::set('tmpl_file', $tmpl_file);
     s::set('app', $app);
     s::set('tmpl_file', $tmpl_file);
     $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $app . '/' . $tmpl_file;
     $code = files::get($file);
     f::set('tmpl_code', $code);
     self::getApps();
     /*
     	Load versions
     */
     db::table('templates_versions');
     db::where('app', $app);
     db::where('tmpl_file', $tmpl_file);
     db::order('version_date', 'DESC');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row['version_date'] = dt::date2print('%H:%i %d.%m.%Y', $row['version_date']);
         $row['version_code'] = '{non}' . htmlspecialchars($row['version_code']) . '{/non}';
         s::roll('versions', $row);
     }
 }
Esempio n. 3
0
File: dt.php Progetto: rigidus/ea
 function update($date)
 {
     if (self::$parts['time']) {
         self::$parts = self::date2parts($date);
     } else {
         self::$parts = self::date2parts($date);
     }
 }
Esempio n. 4
0
 /**
 Returns an date combo from a date record
 
 @param	dates		<b>record</b>		the dates record
 @return	<b>array</b> the combo box (form::combo -compatible format)
 */
 public static function getDatesCombo($dates)
 {
     $dt_m_combo = array();
     while ($dates->fetch()) {
         $dt_m_combo[dt::str('%B %Y', $dates->ts())] = $dates->year() . $dates->month();
     }
     return $dt_m_combo;
 }
Esempio n. 5
0
 function view()
 {
     db::table('news');
     db::order('news_date', 'DESC');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row = filter::get('news_pub', array('unpub', 'pub'), $row);
         $row['news_title'] = strip_tags($row['news_title']);
         $row['news_date'] = dt::date2print('%d %F %Y, %H:%i', $row['news_date']);
         s::roll('news', $row);
     }
 }
Esempio n. 6
0
 function view()
 {
     db::table('admin_log_actions');
     db::join('admin_users', 'admin_log_actions', 'user_id');
     db::order('log_date', 'DESC');
     db::limit(30);
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row['log_date'] = dt::format('%d.%m.%Y %H:%M', $row['log_date']);
         s::roll('logs_list', $row);
     }
 }
Esempio n. 7
0
 function showOne()
 {
     $news_id = web::getThis();
     db::table('news');
     db::where('news_pub', '1');
     $news = db::assoc();
     if (db::rows() == 0) {
         web::error404();
     }
     $news['news_date'] = dt::date2print('%d %F %Y', $news['news_date']);
     s::set('page_title', $news['news_title']);
     s::set('page_header', $news['news_title']);
     s::set($news);
 }
Esempio n. 8
0
 function restore()
 {
     db::table('admin_log_trash');
     db::where('log_id', params::get('log_id'));
     $date = date('Y-m-d H:i:s');
     db::update('log_restored', $date);
     db::table('admin_log_trash');
     db::where('log_id', params::get('log_id'));
     $row = db::assoc();
     if ($row['log_tmpl'] == '1') {
         trash::restore(params::get('log_id'), SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/');
     } else {
         trash::restore(params::get('log_id'));
     }
     buffer::set(dt::date2print('%H:%i:%s<br />%d %F %y', $date));
 }
Esempio n. 9
0
 private function postLine($count, $checked)
 {
     $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
     $sts_class = '';
     switch ($this->rs->post_status) {
         case 1:
             $img_status = sprintf($img, __('Published'), 'check-on.png');
             $sts_class = 'sts-online';
             break;
         case 0:
             $img_status = sprintf($img, __('Unpublished'), 'check-off.png');
             $sts_class = 'sts-offline';
             break;
         case -1:
             $img_status = sprintf($img, __('Scheduled'), 'scheduled.png');
             $sts_class = 'sts-scheduled';
             break;
         case -2:
             $img_status = sprintf($img, __('Pending'), 'check-wrn.png');
             $sts_class = 'sts-pending';
             break;
     }
     $protected = '';
     if ($this->rs->post_password) {
         $protected = sprintf($img, __('Protected'), 'locker.png');
     }
     $selected = '';
     if ($this->rs->post_selected) {
         $selected = sprintf($img, __('Hidden'), 'hidden.png');
     }
     $attach = '';
     $nb_media = $this->rs->countMedia();
     if ($nb_media > 0) {
         $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments');
         $attach = sprintf($img, sprintf($attach_str, $nb_media), 'attach.png');
     }
     $res = '<tr class="line ' . ($this->rs->post_status != 1 ? 'offline ' : '') . $sts_class . '"' . ' id="p' . $this->rs->post_id . '">';
     $cols = array('position' => '<td class="nowrap handle minimal">' . form::field(array('order[' . $this->rs->post_id . ']'), 2, 3, $count + 1, 'position', '', false, 'title="' . sprintf(__('position of %s'), html::escapeHTML($this->rs->post_title)) . '"') . '</td>', 'check' => '<td class="nowrap">' . form::checkbox(array('entries[]'), $this->rs->post_id, $checked, '', '', !$this->rs->isEditable(), 'title="' . __('Select this page') . '"') . '</td>', 'title' => '<td class="maximal" scope="row"><a href="' . $this->core->getPostAdminURL($this->rs->post_type, $this->rs->post_id) . '">' . html::escapeHTML($this->rs->post_title) . '</a></td>', 'date' => '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->post_dt) . '</td>', 'author' => '<td class="nowrap">' . $this->rs->user_id . '</td>', 'comments' => '<td class="nowrap count">' . $this->rs->nb_comment . '</td>', 'trackbacks' => '<td class="nowrap count">' . $this->rs->nb_trackback . '</td>', 'status' => '<td class="nowrap status">' . $img_status . ' ' . $selected . ' ' . $protected . ' ' . $attach . '</td>');
     $cols = new ArrayObject($cols);
     $this->core->callBehavior('adminPagesListValue', $this->core, $this->rs, $cols);
     $res .= implode(iterator_to_array($cols));
     $res .= '</tr>';
     return $res;
 }
Esempio n. 10
0
 function view()
 {
     $groups = ini::parse(SYS_ROOT . 'conf/admin/groups.ini');
     db::table('admin_users');
     if (ADMIN_USER_ID != 1) {
         db::where('user_id', '1', '!=');
     }
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row['user_date_last'] = dt::date2print('%H:%i:%s, %d.%m.%Y', $row['user_date_last']);
         if (isset($groups[$row['group_id']])) {
             $row['group_id'] = $groups[$row['group_id']]['name'];
         }
         if ($row['user_pub'] == '0') {
             $row['user_pub'] = '_unpub';
         } else {
             $row['user_pub'] = '_pub';
         }
         s::roll('users', $row);
     }
 }
Esempio n. 11
0
		<?php 
# début Okatea : affichage des infos
if ($okt->news->config->public_display_date || $okt->news->config->public_display_author || $okt->news->config->categories['enable']) {
    ?>
		<p id="post-infos">
			<?php 
    _e('m_news_published');
    ?>

			<?php 
    # début Okatea : affichage date de l'article
    if ($okt->news->config->public_display_date) {
        ?>
			<?php 
        printf(__('m_news_on_%s'), dt::dt2str(__('%A, %B %d, %Y, %H:%M'), $rsPost->created_at));
        ?>
			<?php 
    }
    # fin Okatea : affichage date de l'article
    ?>

			<?php 
    # début Okatea : affichage l'auteur de l'article
    if ($okt->news->config->public_display_author) {
        ?>
			<?php 
        printf(__('m_news_by_%s'), html::escapeHTML($rsPost->author));
        ?>
			<?php 
    }
Esempio n. 12
0
 /**
 Creates a new comment. Takes a cursor as input and returns the new comment
 ID.
 
 @param	cur		<b>cursor</b>		Comment cursor
 @return	<b>integer</b>		New comment ID
 */
 public function addComment($cur)
 {
     $this->con->writeLock($this->prefix . 'comment');
     try {
         # Get ID
         $rs = $this->con->select('SELECT MAX(comment_id) ' . 'FROM ' . $this->prefix . 'comment ');
         $cur->comment_id = (int) $rs->f(0) + 1;
         $cur->comment_upddt = date('Y-m-d H:i:s');
         $offset = dt::getTimeOffset($this->settings->system->blog_timezone);
         $cur->comment_dt = date('Y-m-d H:i:s', time() + $offset);
         $cur->comment_tz = $this->settings->system->blog_timezone;
         $this->getCommentCursor($cur);
         if ($cur->comment_ip === null) {
             $cur->comment_ip = http::realIP();
         }
         # --BEHAVIOR-- coreBeforeCommentCreate
         $this->core->callBehavior('coreBeforeCommentCreate', $this, $cur);
         $cur->insert();
         $this->con->unlock();
     } catch (Exception $e) {
         $this->con->unlock();
         throw $e;
     }
     # --BEHAVIOR-- coreAfterCommentCreate
     $this->core->callBehavior('coreAfterCommentCreate', $this, $cur);
     $this->triggerComment($cur->comment_id);
     if ($cur->comment_status != -2) {
         $this->triggerBlog();
     }
     return $cur->comment_id;
 }
Esempio n. 13
0
/* DISPLAY
-------------------------------------------------------- */
dcPage::open($page_title, dcPage::jsLoad('js/_trackbacks.js'));
# Exit if we cannot view page
if (!$can_view_page) {
    dcPage::close();
    exit;
}
if (!empty($_GET['sent'])) {
    echo '<p class="message">' . __('All pings sent.') . '</p>';
}
echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . $page_title . '</h2>';
echo '<p><a href="' . $core->getPostAdminURL($post->post_type, $id) . '">&#171; ' . sprintf(__('Back to "%s"'), html::escapeHTML($post->post_title)) . '</a></p>';
echo '<h3 id="entry-preview-title">' . html::escapeHTML($post->post_title) . '</h3>' . '<div class="frame-shrink" id="entry-preview">' . ($post->post_excerpt_xhtml ? $post->post_excerpt_xhtml . '<hr />' : '') . $post->post_content_xhtml . '</div>';
if (!empty($_GET['auto'])) {
    flush();
    $tb_urls = implode("\n", $TB->discover($post->post_excerpt_xhtml . ' ' . $post->post_content_xhtml));
} else {
    $auto_link = '<strong><a href="trackbacks.php?id=' . $id . '&amp;auto=1">' . __('Auto discover ping URLs') . '</a></strong>';
}
echo '<h3>' . __('Ping blogs') . '</h3>' . '<form action="trackbacks.php" id="trackback-form" method="post">' . '<p><label class="area">' . __('URLs to ping:') . form::textarea('tb_urls', 60, 5, $tb_urls) . '</label></p>' . '<p><label class="area">' . __('Send excerpt:') . form::textarea('tb_excerpt', 60, 3, $tb_excerpt) . '</label></p>' . '<p>' . form::hidden('id', $id) . $core->formNonce() . '<input type="submit" value="' . __('Ping blogs') . '" />&nbsp;&nbsp;' . $auto_link . '</p>' . '</form>';
$pings = $TB->getPostPings($id);
if (!$pings->isEmpty()) {
    echo '<h3>' . __('Previously sent pings') . '</h3>';
    echo '<ul class="nice">';
    while ($pings->fetch()) {
        echo '<li>' . dt::dt2str(__('%Y-%m-%d %H:%M'), $pings->ping_dt) . ' - ' . $pings->ping_url . '</li>';
    }
    echo '</ul>';
}
dcPage::close();
Esempio n. 14
0
		<div class="two-cols">
			<p class="field col"><label for="add_language"><?php 
_e('c_c_Language');
?>
</label>
			<?php 
echo form::select('add_language', $aLanguages, html::escapeHTML($add_language));
?>
</p>

			<p class="field col"><label for="add_timezone"><?php 
_e('c_c_Timezone');
?>
</label>
			<?php 
echo form::select('add_timezone', dt::getZones(true, true), html::escapeHTML($add_timezone));
?>
</p>
		</div>

		<?php 
if ($okt->users->config->enable_custom_fields) {
    ?>
		<div class="two-cols">
		<?php 
    # début Okatea : boucle sur les champs
    while ($rsFields->fetch()) {
        ?>

			<div class="col"><?php 
        echo $rsFields->getHtmlField($aPostedData);
Esempio n. 15
0
     echo '<p class="message">' . __('Blog has been successfully created.') . '</p>';
 }
 if (!empty($_GET['upd'])) {
     echo '<p class="message">' . __('Blog has been successfully updated.') . '</p>';
 }
 echo '<div class="multi-part" id="params" title="' . __('Parameters') . '">' . '<h3>' . __('Parameters') . '</h3>' . '<form action="' . $action . '" method="post" id="blog-form">';
 echo '<fieldset><legend>' . __('Blog details') . '</legend>' . $core->formNonce();
 if ($core->auth->isSuperAdmin()) {
     echo '<p><label class="required" title="' . __('Required field') . '">' . __('Blog ID:') . form::field('blog_id', 30, 32, html::escapeHTML($blog_id)) . '</label></p>' . '<p class="form-note">' . __('At least 2 characters using letters, numbers or symbols.') . ' ' . __('Please note that changing your blog ID may require changes in your public index.php file.') . '</p>';
 }
 echo '<p><label class="required" title="' . __('Required field') . '">' . __('Blog name:') . form::field('blog_name', 30, 255, html::escapeHTML($blog_name)) . '</label></p>';
 if ($core->auth->isSuperAdmin()) {
     echo '<p><label class="required" title="' . __('Required field') . '">' . __('Blog URL:') . form::field('blog_url', 30, 255, html::escapeHTML($blog_url)) . '</label></p>' . '<p><label>' . __('URL scan method:') . form::combo('url_scan', $url_scan_combo, $blog_settings->url_scan) . '</label></p>' . '<p><label>' . __('Blog status:') . form::combo('blog_status', $status_combo, $blog_status) . '</label></p>';
 }
 echo '<p class="area"><label for="blog_desc">' . __('Blog description:') . '</label>' . form::textarea('blog_desc', 60, 5, html::escapeHTML($blog_desc)) . '</p>' . '</fieldset>';
 echo '<fieldset><legend>' . __('Blog configuration') . '</legend>' . '<div class="two-cols">' . '<div class="col">' . '<p><label>' . __('Blog editor name:') . form::field('editor', 30, 255, html::escapeHTML($blog_settings->editor)) . '</label></p>' . '<p><label>' . __('Default language:') . form::combo('lang', $lang_combo, $blog_settings->lang, 'l10n') . '</label></p>' . '<p><label>' . __('Blog timezone:') . form::combo('blog_timezone', dt::getZones(true, true), html::escapeHTML($blog_settings->blog_timezone)) . '</label></p>' . '</div>' . '<div class="col">' . '<p><label>' . __('Copyright notice:') . form::field('copyright_notice', 30, 255, html::escapeHTML($blog_settings->copyright_notice)) . '</label></p>' . '<p><label>' . __('New post URL format:') . form::combo('post_url_format', $post_url_combo, html::escapeHTML($blog_settings->post_url_format)) . '</label></p>' . '<p><label class="classic">' . form::checkbox('enable_xmlrpc', '1', $blog_settings->enable_xmlrpc) . __('Enable XML/RPC interface') . '</label>' . ' - <a href="#xmlrpc">' . __('more information') . '</a></p>' . '</div>' . '</div>' . '<br class="clear" />' . '</fieldset>';
 echo '<fieldset><legend>' . __('Comments and trackbacks') . '</legend>' . '<div class="two-cols">' . '<div class="col">' . '<p><label class="classic">' . form::checkbox('allow_comments', '1', $blog_settings->allow_comments) . __('Accept comments') . '</label></p>' . '<p><label class="classic">' . form::checkbox('comments_pub', '1', !$blog_settings->comments_pub) . __('Moderate comments') . '</label></p>' . '<p><label class="classic">' . sprintf(__('Leave comments open for %s days'), form::field('comments_ttl', 2, 3, $blog_settings->comments_ttl)) . '</label></p>' . '<p class="form-note">' . __('Leave blank to disable this feature.') . '</p>' . '<p><label class="classic">' . form::checkbox('wiki_comments', '1', $blog_settings->wiki_comments) . __('Wiki syntax for comments') . '</label></p>' . '</div>' . '<div class="col">' . '<p><label class="classic">' . form::checkbox('allow_trackbacks', '1', $blog_settings->allow_trackbacks) . __('Accept trackbacks') . '</label></p>' . '<p><label class="classic">' . form::checkbox('trackbacks_pub', '1', !$blog_settings->trackbacks_pub) . __('Moderate trackbacks') . '</label></p>' . '<p><label class="classic">' . sprintf(__('Leave trackbacks open for %s days'), form::field('trackbacks_ttl', 2, 3, $blog_settings->trackbacks_ttl)) . '</label></p>' . '<p class="form-note">' . __('Leave blank to disable this feature.') . '</p>' . '<p><label class="classic">' . form::checkbox('comments_nofollow', '1', $blog_settings->comments_nofollow) . __('Add "nofollow" relation on comments and trackbacks links') . '</label></p>' . '</div>' . '</div>' . '<br class="clear" />' . '</fieldset>';
 echo '<fieldset><legend>' . __('Blog presentation') . '</legend>' . '<div class="two-cols">' . '<div class="col">' . '<p><label>' . __('Date format:') . form::field('date_format', 30, 255, html::escapeHTML($blog_settings->date_format)) . '</label></p>' . '<p><label>' . __('Time format:') . form::field('time_format', 30, 255, html::escapeHTML($blog_settings->time_format)) . '</label></p>' . '<p><label class="classic">' . form::checkbox('use_smilies', '1', $blog_settings->use_smilies) . __('Display smilies on entries and comments') . '</label></p>' . '</div>' . '<div class="col">' . '<p><label class="classic">' . sprintf(__('Display %s entries per page'), form::field('nb_post_per_page', 2, 3, $blog_settings->nb_post_per_page)) . '</label></p>' . '<p><label class="classic">' . sprintf(__('Display %s entries per feed'), form::field('nb_post_per_feed', 2, 3, $blog_settings->nb_post_per_feed)) . '</label></p>' . '<p><label class="classic">' . sprintf(__('Display %s comments per feed'), form::field('nb_comment_per_feed', 2, 3, $blog_settings->nb_comment_per_feed)) . '</label></p>' . '<p><label class="classic">' . form::checkbox('short_feed_items', '1', $blog_settings->short_feed_items) . __('Truncate feeds') . '</label></p>' . '</div>' . '</div>' . '<br class="clear" />' . '</fieldset>';
 echo '<fieldset><legend>' . __('Media and images') . '</legend>' . '<div class="two-cols">' . '<div class="col">' . '<h4>' . __('Generated image sizes (in pixels)') . '</h4>' . '<p class="field"><label>' . __('Thumbnails:') . ' ' . form::field('media_img_t_size', 3, 3, $blog_settings->media_img_t_size) . '</label></p>' . '<p class="field"><label>' . __('Small:') . ' ' . form::field('media_img_s_size', 3, 3, $blog_settings->media_img_s_size) . '</label></p>' . '<p class="field"><label>' . __('Medium:') . ' ' . form::field('media_img_m_size', 3, 3, $blog_settings->media_img_m_size) . '</label></p>' . '</div>' . '<div class="col">' . '<h4><label for="media_img_title_pattern">' . __('Inserted image title') . '</label></h4>' . '<p>' . __('This defines image tag title when you insert it in a post from the media manager. It is retrieved from the picture\'s metadata.') . '</p>' . '<p>' . form::combo('media_img_title_pattern', $img_title_combo, html::escapeHTML($blog_settings->media_img_title_pattern)) . '</p>' . '</div>' . '</div>' . '</fieldset>';
 echo '<fieldset><legend>' . __('Search engines robots policy') . '</legend>';
 foreach ($robots_policy_options as $k => $v) {
     echo '<p><label class="classic">' . form::radio(array('robots_policy'), $k, $blog_settings->robots_policy == $k) . ' ' . $v . '</label></p>';
 }
 echo '</fieldset>';
 # --BEHAVIOR-- adminBlogPreferencesForm
 $core->callBehavior('adminBlogPreferencesForm', $core, $blog_settings);
 echo '<p><input type="submit" accesskey="s" value="' . __('save') . '" />' . (!$standalone ? form::hidden('id', $blog_id) : '') . '</p>' . '</form>';
 if ($core->auth->isSuperAdmin() && $blog_id != $core->blog->id) {
     echo '<form action="blog_del.php" method="post">' . '<p><input type="submit" value="' . __('Delete this blog') . '" />' . form::hidden(array('blog_id'), $blog_id) . $core->formNonce() . '</p>' . '</form>';
 }
 # XML/RPC information
Esempio n. 16
0
 foreach ($maintenance->getTabs() as $tab_obj) {
     $res_group = '';
     foreach ($maintenance->getGroups() as $group_obj) {
         $res_task = '';
         foreach ($tasks as $t) {
             if (!$t->id() || $t->group() != $group_obj->id() || $t->tab() != $tab_obj->id()) {
                 continue;
             }
             $res_task .= '<p>' . form::radio(array('task', $t->id()), $t->id()) . ' ' . '<label class="classic" for="' . $t->id() . '">' . html::escapeHTML($t->task()) . '</label>';
             // Expired task alert message
             $ts = $t->expired();
             if ($core->blog->settings->maintenance->plugin_message && $ts !== false) {
                 if ($ts === null) {
                     $res_task .= '<br /> <span class="warn">' . __('This task has never been executed.') . ' ' . __('You should execute it now.') . '</span>';
                 } else {
                     $res_task .= '<br /> <span class="warn">' . sprintf(__('Last execution of this task was on %s.'), dt::str($core->blog->settings->system->date_format, $ts) . ' ' . dt::str($core->blog->settings->system->time_format, $ts)) . ' ' . __('You should execute it now.') . '</span>';
                 }
             }
             $res_task .= '</p>';
         }
         if (!empty($res_task)) {
             $res_group .= '<div class="fieldset">' . '<h4 id="' . $group_obj->id() . '">' . $group_obj->name() . '</h4>' . $res_task . '</div>';
         }
     }
     if (!empty($res_group)) {
         echo '<div id="' . $tab_obj->id() . '" class="multi-part" title="' . $tab_obj->name() . '">' . '<h3>' . $tab_obj->name() . '</h3>' . '<form action="' . $p_url . '" method="post">' . $res_group . '<p><input type="submit" value="' . __('Execute task') . '" /> ' . form::hidden(array('tab'), $tab_obj->id()) . $core->formNonce() . '</p>' . '<p class="form-note info">' . __('This may take a very long time.') . '</p>' . '</form>' . '</div>';
     }
 }
 // Advanced tasks (that required a tab)
 foreach ($tasks as $t) {
     if (!$t->id() || $t->group() !== null) {
Esempio n. 17
0
                throw new Exception(__("Passwords don't match"));
            }
            $cur->user_pwd = $_POST['new_pwd'];
        }
        # --BEHAVIOR-- adminBeforeUserUpdate
        $core->callBehavior('adminBeforeUserUpdate', $cur, $core->auth->userID());
        # Udate user
        $core->updUser($core->auth->userID(), $cur);
        # --BEHAVIOR-- adminAfterUserUpdate
        $core->callBehavior('adminAfterUserUpdate', $cur, $core->auth->userID());
        http::redirect('preferences.php?upd=1');
    } catch (Exception $e) {
        $core->error->add($e->getMessage());
    }
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open($page_title, dcPage::jsLoad('js/_preferences.js') . dcPage::jsConfirmClose('user-form') . $core->callBehavior('adminPreferencesHeaders'));
if (!empty($_GET['upd'])) {
    echo '<p class="message">' . __('Personal information has been successfully updated.') . '</p>';
}
echo '<h2>' . $page_title . '</h2>';
echo '<form action="preferences.php" method="post" id="user-form">' . '<fieldset><legend>' . __('User preferences') . '</legend>' . '<div class="two-cols">' . '<div class="col">' . '<p><label>' . __('Last Name:') . form::field('user_name', 20, 255, html::escapeHTML($user_name), '', 2) . '</label></p>' . '<p><label>' . __('First Name:') . form::field('user_firstname', 20, 255, html::escapeHTML($user_firstname), '', 3) . '</label></p>' . '<p><label>' . __('Display name:') . form::field('user_displayname', 20, 255, html::escapeHTML($user_displayname), '', 4) . '</label></p>' . '<p><label>' . __('Email:') . form::field('user_email', 20, 255, html::escapeHTML($user_email), '', 5) . '</label></p>' . '<p><label>' . __('URL:') . form::field('user_url', 30, 255, html::escapeHTML($user_url), '', 6) . '</label></p>' . '</div>' . '<div class="col">' . '<p><label>' . __('Preferred format:') . form::combo('user_post_format', $formaters_combo, $user_options['post_format'], '', 7) . '</label></p>' . '<p><label>' . __('Default entry status:') . form::combo('user_post_status', $status_combo, $user_post_status, '', 8) . '</label></p>' . '<p><label>' . __('Entry edit field height:') . form::field('user_edit_size', 5, 4, (int) $user_options['edit_size'], '', 9) . '</label></p>' . '<p><label>' . __('User language:') . form::combo('user_lang', $lang_combo, $user_lang, 'l10n', 10) . '</label></p>' . '<p><label>' . __('User timezone:') . form::combo('user_tz', dt::getZones(true, true), $user_tz, '', 11) . '</label></p>' . '<p><label class="classic">' . form::checkbox('user_wysiwyg', 1, $user_options['enable_wysiwyg'], '', 12) . ' ' . __('Enable WYSIWYG mode') . '</label></p>' . '</div>' . '</div>' . '<br class="clear" />' . '</fieldset>';
# --BEHAVIOR-- adminPreferencesForm
$core->callBehavior('adminPreferencesForm', $core);
if ($core->auth->allowPassChange()) {
    echo '<fieldset>' . '<legend>' . __('Change your password') . '</legend>' . '<p><label>' . __('New password:'******'new_pwd', 20, 255, '', '', 30) . '</label></p>' . '<p><label>' . __('Confirm password:'******'new_pwd_c', 20, 255, '', '', 31) . '</label></p>' . '</fieldset>' . '<fieldset>' . '<p>' . __('If you want to change your email or password you must provide your current password.') . '</p>' . '<p><label>' . __('Your password:'******'cur_pwd', 20, 255, '', '', 32) . '</label></p>' . '</fieldset>';
}
echo '<p class="clear">' . $core->formNonce() . '<input type="submit" accesskey="s" value="' . __('Save') . '" tabindex="33" /></p>' . '</form>';
dcPage::helpBlock('core_user_pref');
dcPage::close();
Esempio n. 18
0
 */
# Accès direct interdit
if (!defined('ON_GUESTBOOK_MODULE')) {
    die;
}
if (!empty($_REQUEST['id'])) {
    $sig_id = intval($_REQUEST['id']);
} else {
    $okt->redirect('index.php?' . $url_params);
}
# récupération des infos de la signature
$signature = $okt->guestbook->getSig(array('id' => $sig_id));
$aSigData = array('id' => $sig_id, 'language' => $signature->language, 'message' => $signature->message, 'nom' => $signature->nom, 'email' => $signature->email, 'url' => $signature->url, 'note' => $signature->note, 'visible' => $signature->visible, 'date' => dt::dt2str(__('%A, %B %d, %Y, %H:%M'), $signature->date_sign));
# formulaire envoyé
if (!empty($_POST['edit_form_sent'])) {
    $aSigData = array('id' => $sig_id, 'language' => isset($_POST['language']) ? $_POST['language'] : null, 'message' => isset($_POST['msg']) ? $_POST['msg'] : null, 'nom' => isset($_POST['nom']) ? $_POST['nom'] : null, 'email' => isset($_POST['email']) ? $_POST['email'] : null, 'url' => isset($_POST['url']) ? $_POST['url'] : null, 'note' => isset($_POST['note']) ? intval($_POST['note']) : null, 'visible' => isset($_POST['visible']) ? intval($_POST['visible']) : 1, 'date' => dt::dt2str(__('%A, %B %d, %Y, %H:%M'), $signature->date_sign));
    $aSigData = $okt->guestbook->handleUserData($aSigData);
    if (!$okt->error->hasError()) {
        if ($okt->guestbook->updSig($aSigData)) {
            $okt->page->flashMessages->addSuccess(__('m_guestbook_Signature_was_updated'));
            $okt->redirect('module.php?m=guestbook&amp;action=edit&id=' . $sig_id . $url_params);
        }
    }
}
/* Affichage
----------------------------------------------------------*/
# Titre de la page
$okt->page->addGlobalTitle(__('m_guestbook_Edit_a_signature'));
# En-tête
include OKT_ADMIN_HEADER_FILE;
?>
Esempio n. 19
0
function dcGetImageTitle($file, $pattern)
{
    return $file->media_title;
    $res = array();
    $pattern = preg_split('/\\s*;;\\s*/', $pattern);
    $sep = ', ';
    foreach ($pattern as $v) {
        if ($v == 'Title') {
            $res[] = $file->media_title;
        } elseif ($file->media_meta->{$v}) {
            $res[] = (string) $file->media_meta->{$v};
        } elseif (preg_match('/^Date\\((.+?)\\)$/u', $v, $m)) {
            $res[] = dt::str($m[1], $file->media_dt);
        } elseif (preg_match('/^DateTimeOriginal\\((.+?)\\)$/u', $v, $m) && $file->media_meta->DateTimeOriginal) {
            $res[] = dt::dt2str($m[1], (string) $file->media_meta->DateTimeOriginal);
        } elseif (preg_match('/^separator\\((.*?)\\)$/u', $v, $m)) {
            $sep = $m[1];
        }
    }
    return implode($sep, $res);
}
Esempio n. 20
0
        } catch (InvalidArgumentException $e) {
            $okt->error->set(__('c_c_error_writing_configuration'));
            $okt->error->set($e->getMessage());
        }
    }
}
/* Affichage
----------------------------------------------------------*/
# Liste des langues
$rsLanguages = $okt->languages->getLanguages();
$aLanguages = array();
while ($rsLanguages->fetch()) {
    $aLanguages[html::escapeHTML($rsLanguages->title)] = $rsLanguages->code;
}
# Liste des fuseaux horraires
$aTimezones = dt::getZones(true, true);
# Liste des icônes
$aFlags = array();
foreach (new DirectoryIterator(OKT_PUBLIC_PATH . '/img/flags/') as $oFileInfo) {
    if ($oFileInfo->isDot() || !$oFileInfo->isFile() || $oFileInfo->getExtension() !== 'png') {
        continue;
    }
    $aFlags[str_replace('.png', '', $oFileInfo->getFilename())] = $oFileInfo->getFilename();
}
natsort($aFlags);
# Titre de la page
$okt->page->addGlobalTitle(__('c_a_config_l10n'));
# Javascript
$okt->page->tabs();
$okt->page->validate('add-language-form', array(array('id' => 'add_title', 'rules' => array('required: true')), array('id' => 'add_code', 'rules' => array('required: true', 'minlength: 2'))));
$okt->page->validate('edit-language-form', array(array('id' => 'edit_title', 'rules' => array('required: true')), array('id' => 'edit_code', 'rules' => array('required: true', 'minlength: 2'))));
Esempio n. 21
0
            $core->blog->delComment($comment_id);
            http::redirect($core->getPostAdminURL($rs->post_type, $rs->post_id) . '&co=1#c' . $comment_id, false);
        } catch (Exception $e) {
            $core->error->add($e->getMessage());
        }
    }
    if (!$can_edit) {
        $core->error->add(__("You can't edit this comment."));
    }
}
/* DISPLAY
-------------------------------------------------------- */
dcPage::open(__('Edit comment'), dcPage::jsConfirmClose('comment-form') . dcPage::jsToolBar() . dcPage::jsLoad('js/_comment.js'));
if ($comment_id) {
    if (!empty($_GET['upd'])) {
        echo '<p class="message">' . __('Comment has been successfully updated.') . '</p>';
    }
    $comment_mailto = '';
    if ($comment_email) {
        $comment_mailto = '<a href="mailto:' . html::escapeHTML($comment_email) . '?subject=' . rawurlencode(sprintf(__('Your comment on my blog %s'), $core->blog->name)) . '&body=' . rawurlencode(sprintf(__("Hi!\n\nYou wrote a comment on:\n%s\n\n\n"), $rs->getPostURL())) . '">' . __('Send an e-mail') . '</a>';
    }
    echo '<h2>' . html::escapeHTML($core->blog->name) . ' &rsaquo; ' . __('Edit comment') . '</h2>';
    echo '<p><a class="back" href="' . $core->getPostAdminURL($post_type, $post_id) . '&amp;co=1#c' . $comment_id . '"> ' . sprintf(__('Back to "%s"'), $post_title) . '</a></p>';
    echo '<form action="comment.php" method="post" id="comment-form">' . '<p><label>' . __('IP address:') . '</label> ' . '<a href="comments.php?ip=' . $comment_ip . '">' . $comment_ip . '</a></p>' . '<p><label>' . __('Date:') . '</label> ' . dt::dt2str(__('%Y-%m-%d %H:%M'), $comment_dt) . '</p>' . '<p><label class="required" title="' . __('Required field') . '">' . __('Author:') . form::field('comment_author', 30, 255, html::escapeHTML($comment_author)) . '</label></p>' . '<p><label>' . __('Email:') . form::field('comment_email', 30, 255, html::escapeHTML($comment_email)) . $comment_mailto . '</label></p>' . '<p><label>' . __('Web site:') . form::field('comment_site', 30, 255, html::escapeHTML($comment_site)) . '</label></p>' . '<p><label>' . __('Status:') . form::combo('comment_status', $status_combo, $comment_status, '', '', !$can_publish) . '</label></p>' . $core->callBehavior('adminAfterCommentDesc', $rs) . '<p class="area"><label for="comment_content">' . __('Comment:') . '</label> ' . form::textarea('comment_content', 50, 10, html::escapeHTML($comment_content)) . '</p>' . '<p>' . form::hidden('id', $comment_id) . $core->formNonce() . '<input type="submit" accesskey="s" name="update" value="' . __('save') . '" /> ';
    if ($can_delete) {
        echo '<input type="submit" name="delete" value="' . __('delete') . '" />';
    }
    echo '</p>' . '</form>';
}
dcPage::helpBlock('core_comments');
dcPage::close();
Esempio n. 22
0
        }
    }
}
# Check if setting table exist
$schema = dbSchema::init($core->con);
if (in_array($core->prefix . 'setting', $schema->getTables())) {
    $blog_settings = new bpSettings($core, 'root');
    $user_settings = null;
    /* Set backward compatibility */
    if (!defined('BP_PLANET_URL')) {
        define('BP_PLANET_URL', $blog_settings->get('planet_url'));
    }
    # Set timezone
    $timezone_default = $blog_settings->get('planet_timezone');
    if (!empty($timezone_default)) {
        dt::setTZ($timezone_default);
    }
    #date_default_timezone_set($timezone_default);
    # Set Locale
    $locale = $blog_settings->get('planet_lang');
    # Set log level
    $log = $blog_settings->get('planet_log');
    # Add the global values needed in template
    if (is_file(dirname(__FILE__) . '/../themes/' . $blog_settings->get('planet_theme') . '/index.tpl')) {
        $core->tpl->importFile('index', 'index.tpl', dirname(__FILE__) . '/../themes/' . $blog_settings->get('planet_theme'));
        $core->tpl->setVar('planet', array("url" => BP_PLANET_URL, "theme" => $blog_settings->get('planet_theme'), "title" => $blog_settings->get('planet_title'), "desc" => $blog_settings->get('planet_desc'), "keywords" => $blog_settings->get('planet_keywords'), "desc_meta" => $blog_settings->get('planet_desc_meta'), "msg_info" => $blog_settings->get('planet_msg_info')));
    } else {
        print sprintf(T_("ERROR : The theme '%s' that is configured is not existing in the theme folder."), $blog_settings->get('planet_theme'));
        exit;
    }
    if ($core->auth->sessionExists()) {
Esempio n. 23
0
function showComments(&$rs, $has_action)
{
    echo '<table class="comments-list"><tr>' . '<th colspan="2">' . __('Author') . '</th>' . '<th>' . __('Date') . '</th>' . '<th class="nowrap">' . __('IP address') . '</th>' . '<th>' . __('Status') . '</th>' . '<th>&nbsp;</th>' . '</tr>';
    while ($rs->fetch()) {
        $comment_url = 'comment.php?id=' . $rs->comment_id;
        $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
        switch ($rs->comment_status) {
            case 1:
                $img_status = sprintf($img, __('published'), 'check-on.png');
                break;
            case 0:
                $img_status = sprintf($img, __('unpublished'), 'check-off.png');
                break;
            case -1:
                $img_status = sprintf($img, __('pending'), 'check-wrn.png');
                break;
            case -2:
                $img_status = sprintf($img, __('junk'), 'junk.png');
                break;
        }
        echo '<tr class="line' . ($rs->comment_status != 1 ? ' offline' : '') . '"' . ' id="c' . $rs->comment_id . '">' . '<td class="nowrap">' . ($has_action ? form::checkbox(array('comments[]'), $rs->comment_id, '', '', '', 0) : '') . '</td>' . '<td class="maximal">' . html::escapeHTML($rs->comment_author) . '</td>' . '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $rs->comment_dt) . '</td>' . '<td class="nowrap"><a href="comments.php?ip=' . $rs->comment_ip . '">' . $rs->comment_ip . '</a></td>' . '<td class="nowrap status">' . $img_status . '</td>' . '<td class="nowrap status"><a href="' . $comment_url . '">' . '<img src="images/edit-mini.png" alt="" title="' . __('Edit this comment') . '" /></a></td>' . '</tr>';
    }
    echo '</table>';
}
Esempio n. 24
0
<?php 
echo $okt->page->getButtonSet('galleriesBtSt');
?>

<?php 
if (!empty($aItemData['item']['id'])) {
    ?>
<p><?php 
    printf(__('m_galleries_item_added_on'), '<em>' . dt::dt2str(__('%A, %B %d, %Y, %H:%M'), $aItemData['item']['created_at']) . '</em>');
    ?>

<?php 
    if ($aItemData['item']['updated_at'] > $aItemData['item']['created_at']) {
        ?>
<span class="note"><?php 
        printf(__('m_galleries_item_last_edit'), '<em>' . dt::dt2str(__('%A, %B %d, %Y, %H:%M'), $aItemData['item']['updated_at']) . '</em>');
        ?>
</span>
<?php 
    }
    ?>
</p>
<?php 
}
?>


<?php 
# Construction des onglets
$aItemData['tabs'] = new ArrayObject();
# onglet contenu
Esempio n. 25
0
    if ($rsPostsList->isReadable()) {
        ?>
		<item>
			<title><?php 
        echo html::escapeHTML($rsPostsList->title);
        ?>
</title>
			<link><?php 
        echo html::escapeHTML($okt->config->app_host . $rsPostsList->url);
        ?>
</link>
			<!--
			<guid isPermaLink="false">{{tpl:EntryFeedID}}</guid>
			-->
			<pubDate><?php 
        echo dt::rfc822(strtotime($rsPostsList->created_at), $okt->config->timezone);
        ?>
</pubDate>
			<dc:creator><?php 
        echo html::escapeHTML($rsPostsList->author);
        ?>
</dc:creator>

			<?php 
        if ($okt->news->config->categories['enable'] && $rsPostsList->rubrique_name) {
            ?>
			<category><?php 
            echo html::escapeHTML($rsPostsList->rubrique_name);
            ?>
</category>
			<?php 
Esempio n. 26
0
if (!empty($_GET['upd'])) {
    dcPage::success(__('User has been successfully updated.'));
}
if (!empty($_GET['add'])) {
    dcPage::success(__('User has been successfully created.'));
}
echo '<form action="' . $core->adminurl->get("admin.user") . '" method="post" id="user-form">' . '<div class="two-cols">' . '<div class="col">' . '<h3>' . __('User profile') . '</h3>' . '<p><label for="user_id" class="required"><abbr title="' . __('Required field') . '">*</abbr> ' . __('User ID:') . '</label> ' . form::field('user_id', 20, 255, html::escapeHTML($user_id)) . '</p>' . '<p class="form-note">' . __('At least 2 characters using letters, numbers or symbols.') . '</p>';
if ($user_id == $core->auth->userID()) {
    echo '<p class="warning">' . __('Warning:') . ' ' . __('If you change your username, you will have to log in again.') . '</p>';
}
echo '<div class="pw-table">' . '<p class="pw-cell">' . '<label for="new_pwd" ' . ($user_id != '' ? '' : 'class="required"') . '>' . ($user_id != '' ? '' : '<abbr title="' . __('Required field') . '">*</abbr> ') . ($user_id != '' ? __('New password:'******'Password:'******'</label>' . form::password('new_pwd', 20, 255, '', '', '', false, ' data-indicator="pwindicator" ') . '</p>' . '<div id="pwindicator">' . '    <div class="bar"></div>' . '    <p class="label no-margin"></p>' . '</div>' . '</div>' . '<p class="form-note">' . __('Password must contain at least 6 characters.') . '</p>' . '<p><label for="new_pwd_c" ' . ($user_id != '' ? '' : 'class="required"') . '>' . ($user_id != '' ? '' : '<abbr title="' . __('Required field') . '">*</abbr> ') . __('Confirm password:'******'</label> ' . form::password('new_pwd_c', 20, 255) . '</p>';
if ($core->auth->allowPassChange()) {
    echo '<p><label for="user_change_pwd" class="classic">' . form::checkbox('user_change_pwd', '1', $user_change_pwd) . ' ' . __('Password change required to connect') . '</label></p>';
}
$super_disabled = $user_super && $user_id == $core->auth->userID();
echo '<p><label for="user_super" class="classic">' . form::checkbox('user_super', '1', $user_super, '', '', $super_disabled) . ' ' . __('Super administrator') . '</label></p>' . '<p><label for="user_name">' . __('Last Name:') . '</label> ' . form::field('user_name', 20, 255, html::escapeHTML($user_name)) . '</p>' . '<p><label for="user_firstname">' . __('First Name:') . '</label> ' . form::field('user_firstname', 20, 255, html::escapeHTML($user_firstname)) . '</p>' . '<p><label for="user_displayname">' . __('Display name:') . '</label> ' . form::field('user_displayname', 20, 255, html::escapeHTML($user_displayname)) . '</p>' . '<p><label for="user_email">' . __('Email:') . '</label> ' . form::field('user_email', 20, 255, html::escapeHTML($user_email)) . '</p>' . '<p class="form-note">' . __('Mandatory for password recovering procedure.') . '</p>' . '<p><label for="user_url">' . __('URL:') . '</label> ' . form::field('user_url', 30, 255, html::escapeHTML($user_url)) . '</p>' . '</div>' . '<div class="col">' . '<h3>' . __('Options') . '</h3>' . '<h4>' . __('Interface') . '</h4>' . '<p><label for="user_lang">' . __('Language:') . '</label> ' . form::combo('user_lang', $lang_combo, $user_lang, 'l10n') . '</p>' . '<p><label for="user_tz">' . __('Timezone:') . '</label> ' . form::combo('user_tz', dt::getZones(true, true), $user_tz) . '</p>' . '<h4>' . __('Edition') . '</h4>' . '<p><label for="user_post_format">' . __('Preferred format:') . '</label> ' . form::combo('user_post_format', $formaters_combo, $user_options['post_format']) . '</p>' . '<p><label for="user_post_status">' . __('Default entry status:') . '</label> ' . form::combo('user_post_status', $status_combo, $user_post_status) . '</p>' . '<p><label for="user_edit_size">' . __('Entry edit field height:') . '</label> ' . form::field('user_edit_size', 5, 4, (int) $user_options['edit_size']) . '</p>';
# --BEHAVIOR-- adminUserForm
$core->callBehavior('adminUserForm', isset($rs) ? $rs : null);
echo '</div>' . '</div>';
echo '<p class="clear vertical-separator"><label for="your_pwd" class="required">' . '<abbr title="' . __('Required field') . '">*</abbr> ' . __('Your password:'******'</label>' . form::password('your_pwd', 20, 255) . '</p>' . '<p class="clear"><input type="submit" name="save" accesskey="s" value="' . __('Save') . '" />' . ($user_id != '' ? '' : ' <input type="submit" name="saveplus" value="' . __('Save and create another') . '" />') . ($user_id != '' ? form::hidden('id', $user_id) : '') . $core->formNonce() . '</p>' . '</form>';
if ($user_id) {
    echo '<div class="clear fieldset">' . '<h3>' . __('Permissions') . '</h3>';
    if (!$user_super) {
        echo '<form action="' . $core->adminurl->get("admin.user.actions") . '" method="post">' . '<p><input type="submit" value="' . __('Add new permissions') . '" />' . form::hidden(array('redir'), $core->adminurl->get("admin.user", array('id' => $user_id))) . form::hidden(array('action'), 'blogs') . form::hidden(array('users[]'), $user_id) . $core->formNonce() . '</p>' . '</form>';
        $permissions = $core->getUserPermissions($user_id);
        $perm_types = $core->auth->getPermissionsTypes();
        if (count($permissions) == 0) {
            echo '<p>' . __('No permissions so far.') . '</p>';
        } else {
            foreach ($permissions as $k => $v) {
                if (count($v['p']) > 0) {
?>
" />
  <meta name="dc.language" content="<?php 
echo context::global_filter($core->blog->settings->lang, 0, 0, 0, 0, 0, 'BlogLanguage');
?>
" />
  <meta name="dc.publisher" content="<?php 
echo context::global_filter($core->blog->settings->editor, 1, 0, 0, 0, 0, 'BlogEditor');
?>
" />
  <meta name="dc.rights" content="<?php 
echo context::global_filter($core->blog->settings->copyright_notice, 1, 0, 0, 0, 0, 'BlogCopyrightNotice');
?>
" />
  <meta name="dc.date" scheme="W3CDTF" content="<?php 
echo context::global_filter(dt::iso8601($core->blog->upddt, $core->blog->settings->blog_timezone), 0, 0, 0, 0, 0, 'BlogUpdateDate');
?>
" />
  <meta name="dc.type" content="text" />
  <meta name="dc.format" content="text/html" />
  
  <link rel="contents" title="<?php 
echo __('Archives');
?>
" href="<?php 
echo context::global_filter($core->blog->url . $core->url->getBase("archive"), 0, 0, 0, 0, 0, 'BlogArchiveURL');
?>
" />
  <?php 
$params = array();
$_ctx->categories = $core->blog->getCategories($params);
Esempio n. 28
0
            throw new Exception();
        }
        $feed_reader = new feedReader();
        $feed_reader->setCacheDir(DC_TPL_CACHE);
        $feed_reader->setTimeout(2);
        $feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/');
        $feed = $feed_reader->parse($__resources['rss_news']);
        if ($feed) {
            $latest_news = '<div class="box medium dc-box"><h3>' . __('Dotclear news') . '</h3><dl id="news">';
            $i = 1;
            foreach ($feed->items as $item) {
                $dt = isset($item->link) ? '<a href="' . $item->link . '" class="outgoing" title="' . $item->title . '">' . $item->title . ' <img src="images/outgoing-blue.png" alt="" /></a>' : $item->title;
                if ($i < 3) {
                    $latest_news .= '<dt>' . $dt . '</dt>' . '<dd><p><strong>' . dt::dt2str(__('%d %B %Y:'), $item->pubdate, 'Europe/Paris') . '</strong> ' . '<em>' . text::cutString(html::clean($item->content), 120) . '...</em></p></dd>';
                } else {
                    $latest_news .= '<dt>' . $dt . '</dt>' . '<dd>' . dt::dt2str(__('%d %B %Y:'), $item->pubdate, 'Europe/Paris') . '</dd>';
                }
                $i++;
                if ($i > 2) {
                    break;
                }
            }
            $latest_news .= '</dl></div>';
            $__dashboard_items[$dashboardItem][] = $latest_news;
            $dashboardItem++;
        }
    } catch (Exception $e) {
    }
}
# Documentation links
if ($core->auth->user_prefs->dashboard->doclinks) {
Esempio n. 29
0
 /**
  * Dashboard items stack.
  *
  * @param	$core	<b>dcCore</b>	dcCore instance
  * @param	$items	<b>arrayObject</b>	Dashboard items
  */
 public static function adminDashboardItems($core, $items)
 {
     $core->auth->user_prefs->addWorkspace('maintenance');
     if (!$core->auth->user_prefs->maintenance->dashboard_item) {
         return null;
     }
     $maintenance = new dcMaintenance($core);
     $lines = array();
     foreach ($maintenance->getTasks() as $t) {
         $ts = $t->expired();
         if ($ts === false) {
             continue;
         }
         $lines[] = '<li title="' . ($ts === null ? __('This task has never been executed.') : sprintf(__('Last execution of this task was on %s.'), dt::dt2str($core->blog->settings->system->date_format, $ts) . ' ' . dt::dt2str($core->blog->settings->system->time_format, $ts))) . '">' . $t->task() . '</li>';
     }
     if (empty($lines)) {
         return null;
     }
     $items[] = new ArrayObject(array('<div id="maintenance-expired" class="box small">' . '<h3><img src="' . dcPage::getPF('maintenance/icon-small.png') . '" alt="" /> ' . __('Maintenance') . '</h3>' . '<p class="warning no-margin">' . sprintf(__('There is a task to execute.', 'There are %s tasks to execute.', count($lines)), count($lines)) . '</p>' . '<ul>' . implode('', $lines) . '</ul>' . '<p><a href="' . $core->adminurl->get('admin.plugin.maintenance') . '">' . __('Manage tasks') . '</a></p>' . '</div>'));
 }
Esempio n. 30
0
 private function getPages($blog_id, $user, $pwd, $limit = null, $id = null)
 {
     $this->setUser($user, $pwd);
     $this->setBlog();
     $this->checkPagesPermission();
     $params = array('post_type' => 'page', 'order' => 'post_position ASC, post_title ASC');
     if ($id) {
         $params['post_id'] = (int) $id;
     }
     if ($limit) {
         $params['limit'] = $limit;
     }
     $posts = $this->core->blog->getPosts($params);
     $res = array();
     while ($posts->fetch()) {
         $tres = array("dateCreated" => new xmlrpcDate($posts->getTS()), "userid" => $posts->user_id, "page_id" => $posts->post_id, "page_status" => $this->translateWpStatus((int) $posts->post_status), "description" => $posts->post_content_xhtml, "title" => $posts->post_title, "link" => $posts->getURL(), "permaLink" => $posts->getURL(), "categories" => array(), "excerpt" => $posts->post_excerpt_xhtml, "text_more" => '', "mt_allow_comments" => (int) $posts->post_open_comment, "mt_allow_pings" => (int) $posts->post_open_tb, "wp_slug" => $posts->post_url, "wp_password" => $posts->post_password, "wp_author" => $posts->getAuthorCN(), "wp_page_parent_id" => 0, "wp_page_parent_title" => '', "wp_page_order" => $posts->post_position, "wp_author_id" => $posts->user_id, "wp_author_display_name" => $posts->getAuthorCN(), "date_created_gmt" => new xmlrpcDate(dt::iso8601($posts->getTS(), $posts->post_tz)), "custom_fields" => array(), "wp_page_template" => 'default');
         # --BEHAVIOR-- xmlrpcGetPageInfo
         $this->core->callBehavior('xmlrpcGetPageInfo', $this, array(&$tres));
         $res[] = $tres;
     }
     return $res;
 }