Exemple #1
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;
 }
Exemple #2
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);
}
Exemple #3
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) {
Exemple #4
0
 fake-td"><?php 
    echo html::escapeHTML($sFile);
    ?>
</th>
		<td class="<?php 
    echo $sTdClass;
    ?>
"><?php 
    echo $okt->config->app_path . OKT_PUBLIC_DIR . '/cache';
    ?>
</td>
		<td class="<?php 
    echo $sTdClass;
    ?>
"><?php 
    echo dt::str('%A %d %B %Y %H:%M', filemtime(OKT_PUBLIC_PATH . '/cache/' . $sFile));
    ?>
</td>
		<td class="<?php 
    echo $sTdClass;
    ?>
 small nowrap">
			<ul class="actions">
				<li>
					<a href="configuration.php?action=tools&amp;public_cache_file=<?php 
    echo html::escapeHTML($sFile);
    ?>
"
					onclick="return window.confirm('<?php 
    echo html::escapeJS(__('c_a_tools_cache_confirm_delete'));
    ?>
Exemple #5
0
 public static function message($msg, $timestamp = true, $div = false, $echo = true, $class = 'message')
 {
     global $core;
     $res = '';
     if ($msg != '') {
         $res = ($div ? '<div class="' . $class . '">' : '') . '<p' . ($div ? '' : ' class="' . $class . '"') . '>' . ($timestamp ? dt::str(__('[%H:%M:%S]'), null, $core->auth->getInfo('user_tz')) . ' ' : '') . $msg . '</p>' . ($div ? '</div>' : '');
         if ($echo) {
             echo $res;
         }
     }
     return $res;
 }
Exemple #6
0
 protected function imageMetaCreate(&$cur, $f, $id)
 {
     $file = $this->pwd . '/' . $f;
     if (!file_exists($file)) {
         return false;
     }
     $xml = new xmlTag('meta');
     $meta = imageMeta::readMeta($file);
     $xml->insertNode($meta);
     $c = $this->core->con->openCursor($this->table);
     $c->media_meta = $xml->toXML();
     if ($cur->media_title !== null && $cur->media_title == basename($cur->media_file)) {
         if ($meta['Title']) {
             $c->media_title = $meta['Title'];
         }
     }
     if ($meta['DateTimeOriginal'] && $cur->media_dt === '') {
         # We set picture time to user timezone
         $media_ts = strtotime($meta['DateTimeOriginal']);
         if ($media_ts !== false) {
             $o = dt::getTimeOffset($this->core->auth->getInfo('user_tz'), $media_ts);
             $c->media_dt = dt::str('%Y-%m-%d %H:%M:%S', $media_ts + $o);
         }
     }
     $c->update('WHERE media_id = ' . $id);
 }
Exemple #7
0
# init user bars
$aUserBarA = new ArrayObject();
$aUserBarB = new ArrayObject();
# logged in user
if (!$okt->user->is_guest) {
    # profil link
    $sProfilLink = html::escapeHTML(oktAuth::getUserCN($okt->user->username, $okt->user->lastname, $okt->user->firstname));
    if ($okt->modules->moduleExists('users')) {
        $sProfilLink = '<a href="module.php?m=users&amp;action=profil&amp;id=' . $okt->user->id . '">' . $sProfilLink . '</a>';
    }
    $aUserBarA[10] = sprintf(__('c_c_user_hello_%s'), $sProfilLink);
    unset($sProfilLink);
    # log off link
    $aUserBarA[90] = '<a href="?logout=1">' . __('c_c_user_log_off_action') . '</a>';
    # last visit info
    $aUserBarB[10] = sprintf(__('c_c_user_last_visit_on_%s'), dt::str('%A %d %B %Y %H:%M', $okt->user->last_visit));
} else {
    $aUserBarA[10] = __('c_c_user_hello_you_are_not_logged');
}
# languages switcher
if ($okt->config->admin_lang_switcher && !$okt->languages->unique) {
    $sBaseUri = $okt->config->self_uri;
    $sBaseUri .= strpos($sBaseUri, '?') ? '&' : '?';
    foreach ($okt->languages->list as $aLanguage) {
        if ($aLanguage['code'] == $okt->user->language) {
            continue;
        }
        $aUserBarB[50] = '<a href="' . html::escapeHTML($sBaseUri) . 'switch_lang=' . html::escapeHTML($aLanguage['code']) . '" title="' . html::escapeHTML($aLanguage['title']) . '">' . '<img src="' . OKT_PUBLIC_URL . '/img/flags/' . $aLanguage['img'] . '" alt="' . html::escapeHTML($aLanguage['title']) . '" /></a>';
    }
    unset($sBaseUri, $aLanguage);
}
Exemple #8
0
$default_tab = null;
try {
    # Show filter configuration GUI
    if (!empty($_GET['f'])) {
        if (!isset($filters[$_GET['f']])) {
            throw new Exception(__('Filter does not exist.'));
        }
        if (!$filters[$_GET['f']]->hasGUI()) {
            throw new Exception(__('Filter has no user interface.'));
        }
        $filter = $filters[$_GET['f']];
        $filter_gui = $filter->gui($filter->guiURL());
    }
    # Remove all spam
    if (!empty($_POST['delete_all'])) {
        $ts = dt::str('%Y-%m-%d %H:%M:%S', $_POST['ts'], $core->blog->settings->system->blog_timezone);
        dcAntispam::delAllSpam($core, $ts);
        dcPage::addSuccessNotice(__('Spam comments have been successfully deleted.'));
        http::redirect($p_url);
    }
    # Update filters
    if (isset($_POST['filters_upd'])) {
        $filters_opt = array();
        $i = 0;
        foreach ($filters as $fid => $f) {
            $filters_opt[$fid] = array(false, $i);
            $i++;
        }
        # Enable active filters
        if (isset($_POST['filters_active']) && is_array($_POST['filters_active'])) {
            foreach ($_POST['filters_active'] as $v) {
Exemple #9
0
function dcGetImageTitle($file, $pattern, $dto_first = false, $no_date_alone = false)
{
    $res = array();
    $pattern = preg_split('/\\s*;;\\s*/', $pattern);
    $sep = ', ';
    $dates = 0;
    $items = 0;
    foreach ($pattern as $v) {
        if ($v == 'Title') {
            if ($file->media_title != '') {
                $res[] = $file->media_title;
            }
            $items++;
        } elseif ($file->media_meta->{$v}) {
            if ((string) $file->media_meta->{$v} != '') {
                $res[] = (string) $file->media_meta->{$v};
            }
            $items++;
        } elseif (preg_match('/^Date\\((.+?)\\)$/u', $v, $m)) {
            if ($dto_first && $file->media_meta->DateTimeOriginal != 0) {
                $res[] = dt::dt2str($m[1], (string) $file->media_meta->DateTimeOriginal);
            } else {
                $res[] = dt::str($m[1], $file->media_dt);
            }
            $items++;
            $dates++;
        } elseif (preg_match('/^DateTimeOriginal\\((.+?)\\)$/u', $v, $m) && $file->media_meta->DateTimeOriginal) {
            $res[] = dt::dt2str($m[1], (string) $file->media_meta->DateTimeOriginal);
            $items++;
            $dates++;
        } elseif (preg_match('/^separator\\((.*?)\\)$/u', $v, $m)) {
            $sep = $m[1];
        }
    }
    if ($no_date_alone && $dates == count($res) && $dates < $items) {
        // On ne laisse pas les dates seules, sauf si ce sont les seuls items du pattern (hors séparateur)
        return '';
    }
    return implode($sep, $res);
}
Exemple #10
0
 /**
  * Date to date
  *
  * Format a literal date to another literal date.
  *
  * @param string	$p		Format pattern
  * @param string	$dt		Date
  * @param string	$tz		Timezone
  * @return	string
  */
 public static function dt2str($p, $dt, $tz = null)
 {
     return dt::str($p, strtotime($dt), $tz);
 }
Exemple #11
0
            $user_cn .= ' (' . $users->user_id . ')';
        }
        $users_combo[$user_cn] = $users->user_id;
    }
    while ($categories->fetch()) {
        $categories_combo[str_repeat('&nbsp;&nbsp;', $categories->level - 1) . '&bull; ' . html::escapeHTML($categories->cat_title) . ' (' . $categories->nb_post . ')'] = $categories->cat_id;
    }
    $status_combo = array('-' => '');
    foreach ($core->blog->getAllPostStatus() as $k => $v) {
        $status_combo[$v] = (string) $k;
    }
    $selected_combo = array('-' => '', __('selected') => '1', __('not selected') => '0');
    # Months array
    $dt_m_combo['-'] = '';
    while ($dates->fetch()) {
        $dt_m_combo[dt::str('%B %Y', $dates->ts())] = $dates->year() . $dates->month();
    }
    $lang_combo['-'] = '';
    while ($langs->fetch()) {
        $lang_combo[$langs->post_lang] = $langs->post_lang;
    }
    $sortby_combo = array(__('Date') => 'post_dt', __('Title') => 'post_title', __('Category') => 'cat_title', __('Author') => 'user_id', __('Status') => 'post_status', __('Selected') => 'post_selected');
    $order_combo = array(__('Descending') => 'desc', __('Ascending') => 'asc');
}
# Actions combo box
$combo_action = array();
if ($core->auth->check('publish,contentadmin', $core->blog->id)) {
    $combo_action[__('publish')] = 'publish';
    $combo_action[__('unpublish')] = 'unpublish';
    $combo_action[__('schedule')] = 'schedule';
    $combo_action[__('mark as pending')] = 'pending';
 /**
  * Retourne le HTML du contenu d'une cellule de l'en-tête du calendrier.
  *
  * @param integer $j
  * @return string
  */
 protected function getHeadCelContent($j)
 {
     return sprintf($this->aConfig['htmlHeadCelContent'], dt::str('%a', $j), dt::str('%A', $j));
 }
Exemple #13
0
    echo html::escapeHTML(usersHelpers::getLogoutUrl());
    ?>
"><?php 
    _e('c_c_user_Log_off_action');
    ?>
</a>
		<?php 
    # fin Okatea : lien déconnexion
    ?>
	</p>

	<?php 
    # début Okatea : date de dernière visite
    ?>
	<p><?php 
    printf(__('c_c_user_last_visit_on_%s'), dt::str(__('%A, %B %d, %Y, %H:%M'), $okt->user->last_visit));
    ?>
</p>
	<?php 
    # fin Okatea : date de dernière visite
    ?>

<?php 
} else {
    ?>

	<p>
		<?php 
    _e('c_c_user_hello_you_are_not_logged');
    ?>
Exemple #14
0
             }
         }
     } catch (Exception $e) {
         $core->error->add($e->getMessage());
     }
     echo '<p><label for="blog_status">' . __('Blog status:') . '</label>' . form::combo('blog_status', $status_combo, $blog_status) . '</p>';
 }
 echo '<p class="area"><label for="blog_desc">' . __('Blog description:') . '</label>' . form::textarea('blog_desc', 60, 5, html::escapeHTML($blog_desc)) . '</p>' . '</div>';
 echo '<div class="fieldset"><h4>' . __('Blog configuration') . '</h4>' . '<div class="two-cols">' . '<div class="col">' . '<p><label for="editor">' . __('Blog editor name:') . '</label>' . form::field('editor', 30, 255, html::escapeHTML($blog_settings->system->editor)) . '</p>' . '<p><label for="lang">' . __('Default language:') . '</label>' . form::combo('lang', $lang_combo, $blog_settings->system->lang, 'l10n') . '</p>' . '<p><label for="blog_timezone">' . __('Blog timezone:') . '</label>' . form::combo('blog_timezone', dt::getZones(true, true), html::escapeHTML($blog_settings->system->blog_timezone)) . '</p>' . '<p><label for="copyright_notice">' . __('Copyright notice:') . '</label>' . form::field('copyright_notice', 30, 255, html::escapeHTML($blog_settings->system->copyright_notice)) . '</p>' . '</div>' . '<div class="col">' . '<p><label for="post_url_format">' . __('New post URL format:') . '</label>' . form::combo('post_url_format', $post_url_combo, html::escapeHTML($blog_settings->system->post_url_format)) . '</p>' . '<p><label for="note_title_tag">' . __('HTML tag for the title of the notes on the blog:') . '</label>' . form::combo('note_title_tag', $note_title_tag_combo, $blog_settings->system->note_title_tag) . '</p>' . '<p><label for="enable_xmlrpc" class="classic">' . form::checkbox('enable_xmlrpc', '1', $blog_settings->system->enable_xmlrpc) . __('Enable XML/RPC interface') . '</label>' . '</p>';
 echo '<p class="form-note info">' . __('XML/RPC interface allows you to edit your blog with an external client.') . '</p>';
 if ($blog_settings->system->enable_xmlrpc) {
     echo '<p>' . __('XML/RPC interface is active. You should set the following parameters on your XML/RPC client:') . '</p>' . '<ul>' . '<li>' . __('Server URL:') . ' <strong><code>' . sprintf(DC_XMLRPC_URL, $core->blog->url, $core->blog->id) . '</code></strong></li>' . '<li>' . __('Blogging system:') . ' <strong><code>Movable Type</code></strong></li>' . '<li>' . __('User name:') . ' <strong><code>' . $core->auth->userID() . '</code></strong></li>' . '<li>' . __('Password:'******' <strong><code>&lt;' . __('your password') . '&gt;</code></strong></li>' . '<li>' . __('Blog ID:') . ' <strong><code>1</code></strong></li>' . '</ul>';
 }
 echo '</div>' . '</div>' . '<br class="clear" />' . '</div>';
 echo '<div class="fieldset"><h4>' . __('Comments and trackbacks') . '</h4>' . '<div class="two-cols">' . '<div class="col">' . '<p><label for="allow_comments" class="classic">' . form::checkbox('allow_comments', '1', $blog_settings->system->allow_comments) . __('Accept comments') . '</label></p>' . '<p><label for="comments_pub" class="classic">' . form::checkbox('comments_pub', '1', !$blog_settings->system->comments_pub) . __('Moderate comments') . '</label></p>' . '<p><label for="comments_ttl" class="classic">' . sprintf(__('Leave comments open for %s days') . '.', form::field('comments_ttl', 2, 3, $blog_settings->system->comments_ttl)) . '</label></p>' . '<p class="form-note">' . __('No limit: leave blank.') . '</p>' . '<p><label for="wiki_comments" class="classic">' . form::checkbox('wiki_comments', '1', $blog_settings->system->wiki_comments) . __('Wiki syntax for comments') . '</label></p>' . '<p><label for="comment_preview_optional" class="classic">' . form::checkbox('comment_preview_optional', '1', $blog_settings->system->comment_preview_optional) . __('Preview of comment before submit is not mandatory') . '</label></p>' . '</div>' . '<div class="col">' . '<p><label for="allow_trackbacks" class="classic">' . form::checkbox('allow_trackbacks', '1', $blog_settings->system->allow_trackbacks) . __('Accept trackbacks') . '</label></p>' . '<p><label for="trackbacks_pub" class="classic">' . form::checkbox('trackbacks_pub', '1', !$blog_settings->system->trackbacks_pub) . __('Moderate trackbacks') . '</label></p>' . '<p><label for="trackbacks_ttl" class="classic">' . sprintf(__('Leave trackbacks open for %s days') . '.', form::field('trackbacks_ttl', 2, 3, $blog_settings->system->trackbacks_ttl)) . '</label></p>' . '<p class="form-note">' . __('No limit: leave blank.') . '</p>' . '<p><label for="comments_nofollow" class="classic">' . form::checkbox('comments_nofollow', '1', $blog_settings->system->comments_nofollow) . __('Add "nofollow" relation on comments and trackbacks links') . '</label></p>' . '</div>' . '<br class="clear" />' . '</div>' . '<br class="clear" />' . '</div>';
 echo '<div class="fieldset"><h4>' . __('Blog presentation') . '</h4>' . '<div class="two-cols">' . '<div class="col">' . '<p><label for="date_format">' . __('Date format:') . '</label> ' . form::field('date_format', 30, 255, html::escapeHTML($blog_settings->system->date_format)) . form::combo('date_format_select', $date_formats_combo, '', '', '', false, 'title="' . __('Pattern of date') . '"') . '</p>' . '<p class="chosen form-note">' . __('Sample:') . ' ' . dt::str(html::escapeHTML($blog_settings->system->date_format)) . '</p>' . '<p><label for="time_format">' . __('Time format:') . '</label>' . form::field('time_format', 30, 255, html::escapeHTML($blog_settings->system->time_format)) . form::combo('time_format_select', $time_formats_combo, '', '', '', false, 'title="' . __('Pattern of time') . '"') . '</p>' . '<p class="chosen form-note">' . __('Sample:') . ' ' . dt::str(html::escapeHTML($blog_settings->system->time_format)) . '</p>' . '<p><label for="use_smilies" class="classic">' . form::checkbox('use_smilies', '1', $blog_settings->system->use_smilies) . __('Display smilies on entries and comments') . '</label></p>' . '<p><label for="no_search" class="classic">' . form::checkbox('no_search', '1', $blog_settings->system->no_search) . __('Disable internal search system') . '</label></p>' . '</div>' . '<div class="col">' . '<p><label for="nb_post_for_home" class="classic">' . sprintf(__('Display %s entries on home page'), form::field('nb_post_for_home', 2, 3, $blog_settings->system->nb_post_for_home)) . '</label></p>' . '<p><label for="nb_post_per_page" class="classic">' . sprintf(__('Display %s entries per page'), form::field('nb_post_per_page', 2, 3, $blog_settings->system->nb_post_per_page)) . '</label></p>' . '<p><label for="nb_post_per_feed" class="classic">' . sprintf(__('Display %s entries per feed'), form::field('nb_post_per_feed', 2, 3, $blog_settings->system->nb_post_per_feed)) . '</label></p>' . '<p><label for="nb_comment_per_feed" class="classic">' . sprintf(__('Display %s comments per feed'), form::field('nb_comment_per_feed', 2, 3, $blog_settings->system->nb_comment_per_feed)) . '</label></p>' . '<p><label for="short_feed_items" class="classic">' . form::checkbox('short_feed_items', '1', $blog_settings->system->short_feed_items) . __('Truncate feeds') . '</label></p>' . '<p><label for="inc_subcats" class="classic">' . form::checkbox('inc_subcats', '1', $blog_settings->system->inc_subcats) . __('Include sub-categories in category page and category posts feed') . '</label></p>' . '</div>' . '</div>' . '<br class="clear" />' . '</div>';
 echo '<div class="fieldset"><h4 id="medias-settings">' . __('Media and images') . '</h4>' . '<p class="form-note warning">' . __('Please note that if you change current settings bellow, they will now apply to all new images in the media manager.') . ' ' . __('Be carefull if you share it with other blogs in your installation.') . '</p>' . '<div class="two-cols">' . '<div class="col">' . '<h5>' . __('Generated image sizes (in pixels)') . '</h5>' . '<p class="field"><label for="media_img_t_size">' . __('Thumbnail') . '</label> ' . form::field('media_img_t_size', 3, 3, $blog_settings->system->media_img_t_size) . '</p>' . '<p class="field"><label for="media_img_s_size">' . __('Small') . '</label> ' . form::field('media_img_s_size', 3, 3, $blog_settings->system->media_img_s_size) . '</p>' . '<p class="field"><label for="media_img_m_size">' . __('Medium') . '</label> ' . form::field('media_img_m_size', 3, 3, $blog_settings->system->media_img_m_size) . '</p>' . '<h5>' . __('Default size of the inserted video (in pixels)') . '</h5>' . '<p class="field"><label for="media_video_width">' . __('Width') . '</label> ' . form::field('media_video_width', 3, 3, $blog_settings->system->media_video_width) . '</p>' . '<p class="field"><label for="media_video_height">' . __('Height') . '</label> ' . form::field('media_video_height', 3, 3, $blog_settings->system->media_video_height) . '</p>' . '<h5>' . __('Flash player') . '</h5>' . '<p><label for="media_flash_fallback">' . form::checkbox('media_flash_fallback', '1', $blog_settings->system->media_flash_fallback) . __('Insert Flash player fallback for video (mp4 or m4v) and audio (mp3) media') . '</label></p>' . '<p class="form-note info">' . __('For flv video, the Flash player will be anyway inserted.') . '</p>' . '</div>' . '<div class="col">' . '<h5>' . __('Default image insertion attributes') . '</h5>' . '<p class="vertical-separator"><label for="media_img_title_pattern">' . __('Inserted image title') . '</label>' . form::combo('media_img_title_pattern', $img_title_combo, html::escapeHTML($blog_settings->system->media_img_title_pattern)) . '</p>' . '<p><label for="media_img_use_dto_first" class="classic">' . form::checkbox('media_img_use_dto_first', '1', $blog_settings->system->media_img_use_dto_first) . __('Use original media date if possible') . '</label></p>' . '<p><label for="media_img_no_date_alone" class="classic">' . form::checkbox('media_img_no_date_alone', '1', $blog_settings->system->media_img_no_date_alone) . __('Do not display date if alone in title') . '</label></p>' . '<p class="form-note info">' . __('It is retrieved from the picture\'s metadata.') . '</p>' . '<p class="field vertical-separator"><label for="media_img_default_size">' . __('Size of inserted image:') . '</label>' . form::combo('media_img_default_size', $img_default_size_combo, html::escapeHTML($blog_settings->system->media_img_default_size) != '' ? html::escapeHTML($blog_settings->system->media_img_default_size) : 'm') . '</p>' . '<p class="field"><label for="media_img_default_alignment">' . __('Image alignment:') . '</label>' . form::combo('media_img_default_alignment', $img_default_alignment_combo, html::escapeHTML($blog_settings->system->media_img_default_alignment)) . '</p>' . '<p><label for="media_img_default_link">' . form::checkbox('media_img_default_link', '1', $blog_settings->system->media_img_default_link) . __('Insert a link to the original image') . '</label></p>' . '</div>' . '</div>' . '<br class="clear" />' . '</div>';
 echo '<div class="fieldset"><h4>' . __('Search engines robots policy') . '</h4>';
 $i = 0;
 foreach ($robots_policy_options as $k => $v) {
     echo '<p><label for="robots_policy-' . $i . '" class="classic">' . form::radio(array('robots_policy', 'robots_policy-' . $i), $k, $blog_settings->system->robots_policy == $k) . ' ' . $v . '</label></p>';
     $i++;
 }
 echo '</div>';
 echo '<div class="fieldset"><h4>' . __('jQuery javascript library') . '</h4>' . '<p><label for="jquery_version" class="classic">' . __('jQuery version to be loaded for this blog:') . '</label>' . ' ' . form::combo('jquery_version', $jquery_versions_combo, $blog_settings->system->jquery_version) . '</p>' . '<br class="clear" />' . '</div>';
 echo '<div class="fieldset"><h4>' . __('Blog security') . '</h4>' . '<p><label for="prevents_clickjacking" class="classic">' . form::checkbox('prevents_clickjacking', '1', $blog_settings->system->prevents_clickjacking) . __('Protect the blog from Clickjacking (see <a href="https://en.wikipedia.org/wiki/Clickjacking">Wikipedia</a>)') . '</label></p>' . '<br class="clear" />' . '</div>';
 # --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="' . $core->adminurl->get("admin.blog.del") . '" method="post">' . '<p><input type="submit" class="delete" value="' . __('Delete this blog') . '" />' . form::hidden(array('blog_id'), $blog_id) . $core->formNonce() . '</p>' . '</form>';
Exemple #15
0
 public static function getAge($attr)
 {
     if (isset($attr['age']) && preg_match('/^(\\-[0-9]+|last).*$/i', $attr['age'])) {
         if (($ts = strtotime($attr['age'])) !== false) {
             return dt::str('%Y-%m-%d %H:%m:%S', $ts);
         }
     }
     return '';
 }
Exemple #16
0
function blogLine($rs)
{
    global $core;
    $blog_id = html::escapeHTML($rs->blog_id);
    $edit_link = '';
    if ($GLOBALS['core']->auth->isSuperAdmin()) {
        $edit_link = '<a href="' . $core->adminurl->get("admin.blog", array('id' => $blog_id)) . '"  title="' . sprintf(__('Edit blog settings for %s'), $blog_id) . '">' . '<img src="images/edit-mini.png" alt="' . __('Edit blog settings') . '" /> ' . $blog_id . '</a> ';
    } else {
        $edit_link = $blog_id;
    }
    $img_status = $rs->blog_status == 1 ? 'check-on' : ($rs->blog_status == 0 ? 'check-off' : 'check-wrn');
    $txt_status = $GLOBALS['core']->getBlogStatus($rs->blog_status);
    $img_status = sprintf('<img src="images/%1$s.png" alt="%2$s" title="%2$s" />', $img_status, $txt_status);
    $offset = dt::getTimeOffset($core->auth->getInfo('user_tz'));
    $blog_upddt = dt::str(__('%Y-%m-%d %H:%M'), strtotime($rs->blog_upddt) + $offset);
    return '<tr class="line">' . '<td class="nowrap">' . $edit_link . '</td>' . '<td class="maximal"><a href="' . $core->adminurl->get("admin.home", array('switchblog' => $rs->blog_id)) . '" ' . 'title="' . sprintf(__('Switch to blog %s'), $rs->blog_id) . '">' . html::escapeHTML($rs->blog_name) . '</a></td>' . '<td class="nowrap"><a class="outgoing" href="' . html::escapeHTML($rs->blog_url) . '">' . html::escapeHTML($rs->blog_url) . ' <img src="images/outgoing-blue.png" alt="" /></a></td>' . '<td class="nowrap count">' . $core->countBlogPosts($rs->blog_id) . '</td>' . '<td class="nowrap count">' . $blog_upddt . '</td>' . '<td class="status">' . $img_status . '</td>' . '</tr>';
}