Exemple #1
0
/**
 * Task title
 */
function task_title_link($Item)
{
    global $current_User;
    $col = locale_flag($Item->locale, 'w16px', 'flag', '', false) . ' ';
    $Item->get_Blog();
    if ($Item->Blog->allowcomments != 'never') {
        // The current blog can have comments:
        $nb_comments = generic_ctp_number($Item->ID, 'feedback');
        $col .= '<a href="?ctrl=items&amp;blog=' . $Item->blog_ID . '&amp;p=' . $Item->ID . '"
						title="' . sprintf(T_('%d feedbacks'), $nb_comments) . '" class="">';
        if ($nb_comments) {
            $col .= get_icon('comments');
        } else {
            $col .= get_icon('nocomment');
        }
        $col .= '</a> ';
    }
    $col .= '<a href="?ctrl=items&amp;blog=' . $Item->blog_ID . '&amp;p=' . $Item->ID . '" class="" title="' . T_('View this post...') . '">' . $Item->dget('title') . '</a></strong>';
    return $col;
}
 /**
  * Template tag
  */
 function locale_flag($params = array())
 {
     // Make sure we are not missing any param:
     $params = array_merge(array('before' => ' ', 'after' => ' ', 'collection' => 'h10px', 'format' => 'htmlbody', 'class' => 'flag', 'align' => '', 'locale' => 'item'), $params);
     if ($params['locale'] == 'blog') {
         $params['locale'] = $this->get_Blog()->locale;
     } elseif ($params['locale'] == 'item') {
         $params['locale'] = $this->locale;
     }
     echo $params['before'];
     echo locale_flag($params['locale'], $params['collection'], $params['class'], $params['align']);
     echo $params['after'];
 }
Exemple #3
0
/**
 * Get a link with task title
 *
 * @param object Item
 * @param boolean Display country flag
 * @param boolean Display status banner
 * @return string Link
 */
function task_title_link($Item, $display_flag = true, $display_status = false)
{
    global $current_User, $admin_url;
    $col = '';
    if ($display_status && is_logged_in()) {
        // Display status
        $col .= $Item->get_status(array('format' => 'styled'));
    }
    if ($display_flag) {
        // Display country flag
        $col .= locale_flag($Item->locale, 'w16px', 'flag', '', false) . ' ';
    }
    $Item->get_Blog();
    if (is_admin_page()) {
        // Url to item page in backoffice
        $item_url = $admin_url . '?ctrl=items&amp;blog=' . $Item->get_blog_ID() . '&amp;p=' . $Item->ID;
    } else {
        // Url to item page in frontoffice
        $item_url = $Item->get_permanent_url();
    }
    if ($Item->Blog->get_setting('allow_comments') != 'never') {
        // The current blog can have comments:
        $nb_comments = generic_ctp_number($Item->ID, 'feedback');
        $comments_url = is_admin_page() ? $item_url : url_add_tail($item_url, '#comments');
        $col .= '<a href="' . $comments_url . '" title="' . sprintf(T_('%d feedbacks'), $nb_comments) . '" class="">';
        if ($nb_comments) {
            $col .= get_icon('comments');
        } else {
            $col .= get_icon('nocomment');
        }
        $col .= '</a> ';
    }
    $col .= '<a href="' . $item_url . '" class="" title="' . T_('View this post...') . '">' . $Item->dget('title') . '</a></strong>';
    return $col;
}
Exemple #4
0
        locale_temp_switch($lkey);
        $datefmt_preview = date_i18n($locales[$lkey]['datefmt'], $localtimenow);
        $timefmt_preview = date_i18n($locales[$lkey]['timefmt'], $localtimenow);
        locale_restore_previous();
        ?>
		<tr class="<?php 
        echo $i % 2 == 1 ? 'odd' : 'even';
        ?>
">
		<td class="firstcol left" title="<?php 
        echo T_('Priority') . ': ' . $locales[$lkey]['priority'] . ', ' . T_('Charset') . ': ' . $locales[$lkey]['charset'] . ', ' . T_('Lang file') . ': ' . $locales[$lkey]['messages'];
        ?>
">
			<?php 
        echo '<input type="hidden" name="loc_' . $i . '_locale" value="' . $lkey . '" />';
        locale_flag($lkey);
        echo '
			<strong>';
        if ($current_User->check_perm('options', 'edit')) {
            echo '<a href="' . $pagenow . '?ctrl=locales&amp;action=edit&amp;edit_locale=' . $lkey . ($loc_transinfo ? '&amp;loc_transinfo=1' : '') . '" title="' . T_('Edit locale') . '">';
        }
        echo $lkey;
        if ($current_User->check_perm('options', 'edit')) {
            echo '</a>';
        }
        // TODO: Update title attribs for datefmt/timefmt onchange through AJAX  -- fp> all that complexity for an invisible tooltip... :/ Users should update the format on the detailed screen and get a dynamic preview there. Maybe the date and time should be editable on the list at all. There is no help here either. Users should be encouraged to go to the detailed screen )
        echo '</strong></td>
				<td class="center">
					<input type="checkbox" name="loc_' . $i . '_enabled" value="1"' . ($locales[$lkey]['enabled'] ? 'checked="checked"' : '') . ' />
				</td>
				<td>
Exemple #5
0
 /**
  * Template tag
  */
 function locale_flag($params = array())
 {
     // Make sure we are not missing any param:
     $params = array_merge(array('before' => ' ', 'after' => ' ', 'collection' => 'h10px', 'format' => 'htmlbody', 'class' => 'flag', 'align' => ''), $params);
     echo $params['before'];
     echo locale_flag($this->locale, $params['collection'], $params['class'], $params['align']);
     echo $params['after'];
 }
Exemple #6
0
/**
 * Get a blog locale with link to edit
 *
 * @param string Blog locale
 * @param integer Blog ID
 * @return string Link
 */
function blog_row_locale($coll_locale, $coll_ID)
{
    global $current_User, $admin_url;
    $coll_locale = locale_flag($coll_locale, NULL, NULL, NULL, false);
    if ($current_User->check_perm('blog_properties', 'edit', false, $coll_ID)) {
        // Blog setting & can edit
        $edit_url = $admin_url . '?ctrl=coll_settings&amp;blog=' . $coll_ID;
        $r = '<a href="' . $edit_url . '" title="' . T_('Edit properties...') . '">';
        $r .= $coll_locale;
        $r .= '</a>';
    } else {
        $r = $coll_locale;
    }
    return $r;
}
/**
 * Language selector
 */
function display_locale_selector()
{
    global $locales, $default_locale, $action;
    static $selector_already_displayed = false;
    if ($selector_already_displayed) {
        return;
    }
    $selector_already_displayed = true;
    block_open(T_('Language / Locale'));
    ?>
	<ul class="pager pull-right" style="margin:0">
		<li class="next"><a href="index.php?action=localeinfo&amp;locale=<?php 
    echo $default_locale;
    ?>
">More languages <span aria-hidden="true">&rarr;</span></a></li>
	</ul>

	<?php 
    if (isset($locales[$default_locale])) {
        $default_locale_option_title = locale_flag($default_locale, 'w16px', 'flag', '', false) . ' ' . $locales[$default_locale]['name'];
    }
    $locale_options = '';
    foreach ($locales as $lkey => $lvalue) {
        $locale_options .= '<li><a href="index.php?locale=' . $lkey . '">' . locale_flag($lkey, 'w16px', 'flag', '', false) . ' ' . T_($lvalue['name']) . '</a></li>' . "\n";
    }
    ?>
	<div class="btn-group install-language">
		<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
			<?php 
    echo $default_locale_option_title;
    ?>
			<span class="caret"></span>
		</button>
		<ul class="dropdown-menu" role="menu">
		<?php 
    echo $locale_options;
    ?>
		</ul>
	</div>

	<noscript>
		<style type="text/css">.install-language{display:none;}</style>
		<form action="index.php" method="get" class="form-inline">
		<select name="locale" class="form-control">
		<?php 
    foreach ($locales as $lkey => $lvalue) {
        echo '<option' . ($default_locale == $lkey ? ' selected="selected"' : '') . ' value="' . $lkey . '">';
        echo T_($lvalue['name']);
        echo '</option>';
    }
    ?>
		</select>
		<input type="submit" value="<?php 
    echo T_('Select as default language/locale');
    ?>
" class="btn btn-primary" />
		</form>
	</noscript>
	<?php 
    block_close();
}
			<div class="centerTitle"><?php 
        $Item->title();
        ?>
</div>
			<div class="centerContent">
			<?php 
        $MainList->date_if_changed(array('before' => '', 'after' => '', 'date_format' => '#'));
        $Item->issue_time(array('before' => '@ ', 'after' => ' '));
        $Item->categories(array('before' => T_('Categories') . ': ', 'after' => ' ', 'include_main' => true, 'include_other' => true, 'include_external' => true, 'link_categories' => true));
        // List all tags attached to this post:
        $Item->tags(array('before' => ', ' . T_('Tags') . ': ', 'after' => ' ', 'separator' => ', '));
        echo ', ';
        $Item->wordcount();
        echo ' ', T_('words');
        echo ' &nbsp; ';
        locale_flag($Item->locale, 'h10px', 'flag', '');
        // ---------------------- POST CONTENT INCLUDED HERE ----------------------
        skin_include('_item_content.inc.php', array('image_size' => 'fit-400x320'));
        // Note: You can customize the default item feedback by copying the generic
        // /skins/_item_feedback.inc.php file into the current skin folder.
        // -------------------------- END OF POST CONTENT -------------------------
        // Link to comments, trackbacks, etc.:
        $Item->feedback_link(array('type' => 'comments', 'link_before' => ' &bull; ', 'link_after' => '', 'link_text_zero' => '#', 'link_text_one' => '#', 'link_text_more' => '#', 'link_title' => '#', 'use_popup' => false));
        $Item->edit_link(array('before' => ' &bull; ', 'after' => ''));
        $Item->permanent_link();
        ?>
			</div>

			<?php 
        // ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------
        skin_include('_item_feedback.inc.php', array('before_section_title' => '<h4>', 'after_section_title' => '</h4>'));