Пример #1
0
 /**
  * Method to generate html code for a list of buttons
  *
  * @param   array|object   $button  Button properties
  * @return  string
  */
 public static function button($button)
 {
     if (!empty($button['access'])) {
         if (is_bool($button['access'])) {
             if ($button['access'] == false) {
                 return '';
             }
         } else {
             // Take each pair of permission, context values.
             for ($i = 0, $n = count($button['access']); $i < $n; $i += 2) {
                 if (!\User::authorise($button['access'][$i], $button['access'][$i + 1])) {
                     return '';
                 }
             }
         }
     }
     $html[] = '<div class="icon-wrapper"' . (empty($button['id']) ? '' : ' id="' . $button['id'] . '"') . '>';
     $html[] = '<div class="icon">';
     $html[] = '<a href="' . $button['link'] . '"';
     $html[] = empty($button['target']) ? '' : ' target="' . $button['target'] . '"';
     $html[] = empty($button['onclick']) ? '' : ' onclick="' . $button['onclick'] . '"';
     $html[] = empty($button['title']) ? '' : ' title="' . htmlspecialchars($button['title']) . '"';
     $html[] = '>';
     if (isset($button['image']) && $button['image']) {
         $html[] = \Html::asset('image', empty($button['image']) ? '' : $button['image'], empty($button['alt']) ? null : htmlspecialchars($button['alt']), null, true);
     }
     $html[] = empty($button['text']) ? '' : '<span>' . $button['text'] . '</span>';
     $html[] = '</a>';
     $html[] = '</div>';
     $html[] = '</div>';
     return implode($html);
 }
Пример #2
0
 /**
  * @param	int $itemid	The menu item id
  */
 static function association($itemid)
 {
     // Get the associations
     $associations = MenusHelper::getAssociations($itemid);
     // Get the associated menu items
     $db = App::get('db');
     $query = $db->getQuery(true);
     $query->select('m.*');
     $query->select('mt.title as menu_title');
     $query->from('#__menu as m');
     $query->leftJoin('#__menu_types as mt ON mt.menutype=m.menutype');
     $query->where('m.id IN (' . implode(',', array_values($associations)) . ')');
     $query->leftJoin('#__languages as l ON m.language=l.lang_code');
     $query->select('l.image');
     $query->select('l.title as language_title');
     $db->setQuery($query);
     $items = $db->loadObjectList('id');
     // Check for a database error.
     if ($error = $db->getErrorMsg()) {
         throw new Exception($error, 500);
         return false;
     }
     // Construct html
     $text = array();
     foreach ($associations as $tag => $associated) {
         if ($associated != $itemid) {
             $text[] = Lang::txt('COM_MENUS_TIP_ASSOCIATED_LANGUAGE', Html::asset('image', 'mod_languages/' . $items[$associated]->image . '.gif', $items[$associated]->language_title, array('title' => $items[$associated]->language_title), true), $items[$associated]->title, $items[$associated]->menu_title);
         }
     }
     return JHtml::_('tooltip', implode('<br />', $text), Lang::txt('COM_MENUS_TIP_ASSOCIATION'), 'menu/icon-16-links.png');
 }
Пример #3
0
 /**
  * method to generate an information about the default language
  *
  * @param	boolean	$published is the language the default?
  *
  * @return	string	html code
  */
 public static function published($published)
 {
     if ($published) {
         return Html::asset('image', 'menu/icon-16-default.png', Lang::txt('COM_LANGUAGES_HEADING_DEFAULT'), NULL, true);
     } else {
         return '&#160;';
     }
 }
Пример #4
0
 /**
  * @param	int $value	The state value
  * @param	int $i
  */
 public static function state($value = 0, $i)
 {
     // Array of image, task, title, action
     $states = array(1 => array('tick.png', 'newsfeeds.unpublish', 'JPUBLISHED', 'COM_NEWSFEEDS_UNPUBLISH_ITEM'), 0 => array('publish_x.png', 'newsfeeds.publish', 'JUNPUBLISHED', 'COM_NEWSFEEDS_PUBLISH_ITEM'));
     $state = \Hubzero\Utility\Arr::getValue($states, (int) $value, $states[0]);
     $html = '<a href="#" onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" title="' . Lang::txt($state[3]) . '">' . Html::asset('image', 'admin/' . $state[0], Lang::txt($state[2]), NULL, true) . '</a>';
     return $html;
 }
 /**
  * @param	int $value	The state value
  * @param	int $i
  */
 static function featured($value = 0, $i, $canChange = true)
 {
     // Array of image, task, title, action
     $states = array(0 => array('disabled.png', 'articles.featured', 'COM_CONTENT_UNFEATURED', 'COM_CONTENT_TOGGLE_TO_FEATURE'), 1 => array('featured.png', 'articles.unfeatured', 'COM_CONTENT_FEATURED', 'COM_CONTENT_TOGGLE_TO_UNFEATURE'));
     $state = \Hubzero\Utility\Arr::getValue($states, (int) $value, $states[1]);
     $html = Html::asset('image', 'admin/' . $state[0], Lang::txt($state[2]), NULL, true);
     if ($canChange) {
         $html = '<a href="#" class="state ' . ($value ? 'yes' : 'no') . '" onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" title="' . Lang::txt($state[3]) . '">' . $html . '</a>';
     }
     return $html;
 }
Пример #6
0
 function __construct($config = array())
 {
     // Article frontpage Editor pagebreak proxying:
     if (Request::getCmd('view') === 'article' && Request::getCmd('layout') === 'pagebreak') {
         $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
     } elseif (Request::getCmd('view') === 'articles' && Request::getCmd('layout') === 'modal') {
         Html::asset('stylesheet', 'adminlist.css', array(), true);
         $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR;
     }
     parent::__construct($config);
 }
Пример #7
0
 /**
  * @param	int $value	The state value
  * @param	int $i
  */
 public static function state($value = 0, $i, $canChange)
 {
     // Array of image, task, title, action.
     $states = array(-2 => array('trash.png', 'messages.unpublish', 'JTRASHED', 'COM_MESSAGES_MARK_AS_UNREAD'), 1 => array('tick.png', 'messages.unpublish', 'COM_MESSAGES_OPTION_READ', 'COM_MESSAGES_MARK_AS_UNREAD'), 0 => array('publish_x.png', 'messages.publish', 'COM_MESSAGES_OPTION_UNREAD', 'COM_MESSAGES_MARK_AS_READ'));
     $state = \Hubzero\Utility\Arr::getValue($states, (int) $value, $states[0]);
     $html = Html::asset('image', 'admin/' . $state[0], Lang::txt($state[2]), NULL, true);
     if ($canChange) {
         $html = '<a href="#" onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[1] . '\')" title="' . Lang::txt($state[3]) . '">' . $html . '</a>';
     }
     return $html;
 }
Пример #8
0
 /**
  * Display the thumb for the template.
  *
  * @param   string   $template   The name of the active view.
  * @param   integer  $protected
  * @return  string
  */
 public static function thumb($template, $protected = 0)
 {
     $basePath = ($protected == 0 ? PATH_APP : PATH_CORE) . '/templates/' . $template;
     $baseUrl = Request::root(true) . ($protected == 0 ? '/app' : '/core');
     $thumb = $basePath . '/template_thumbnail.png';
     $preview = $basePath . '/template_preview.png';
     $html = '';
     if (file_exists($thumb)) {
         $html = Html::asset('image', ltrim(substr($thumb, strlen(PATH_ROOT)), DS), Lang::txt('COM_TEMPLATES_PREVIEW'));
         if (file_exists($preview)) {
             $preview = $baseUrl . '/templates/' . $template . '/template_preview.png';
             $html = '<a href="' . $preview . '" class="modal" title="' . Lang::txt('COM_TEMPLATES_CLICK_TO_ENLARGE') . '">' . $html . '</a>';
         }
     }
     return $html;
 }
Пример #9
0
 /**
  * Prepare content
  *
  * @param   string   $context  The context of the content being passed to the plugin.
  * @param   object   $article  The article object.  Note $article->text is also available
  * @param   object   $params   The article params
  * @param   integer  $page     The 'page' number
  * @return  void
  */
 public function onContentBeforeDisplay($context, &$row, &$params, $page = 0)
 {
     $html = '';
     if ($params->get('show_vote')) {
         $rating = intval(@$row->rating);
         $rating_count = intval(@$row->rating_count);
         $view = Request::getString('view', '');
         $img = '';
         // look for images in template if available
         $starImageOn = Html::asset('image', 'system/rating_star.png', NULL, NULL, true);
         $starImageOff = Html::asset('image', 'system/rating_star_blank.png', NULL, NULL, true);
         for ($i = 0; $i < $rating; $i++) {
             $img .= $starImageOn;
         }
         for ($i = $rating; $i < 5; $i++) {
             $img .= $starImageOff;
         }
         $html .= '<span class="content_rating">';
         $html .= Lang::txt('PLG_VOTE_USER_RATING', $img, $rating_count);
         $html .= "</span>\n<br />\n";
         if ($view == 'article' && $row->state == 1) {
             $uri = JFactory::getURI();
             $uri->setQuery($uri->getQuery() . '&hitcount=0');
             $html .= '<form method="post" action="' . htmlspecialchars($uri->toString()) . '">';
             $html .= '<div class="content_vote">';
             $html .= Lang::txt('PLG_VOTE_POOR');
             $html .= '<input type="radio" title="' . Lang::txt('PLG_VOTE_VOTE', '1') . '" name="user_rating" value="1" />';
             $html .= '<input type="radio" title="' . Lang::txt('PLG_VOTE_VOTE', '2') . '" name="user_rating" value="2" />';
             $html .= '<input type="radio" title="' . Lang::txt('PLG_VOTE_VOTE', '3') . '" name="user_rating" value="3" />';
             $html .= '<input type="radio" title="' . Lang::txt('PLG_VOTE_VOTE', '4') . '" name="user_rating" value="4" />';
             $html .= '<input type="radio" title="' . Lang::txt('PLG_VOTE_VOTE', '5') . '" name="user_rating" value="5" checked="checked" />';
             $html .= Lang::txt('PLG_VOTE_BEST');
             $html .= '&#160;<input class="button" type="submit" name="submit_vote" value="' . Lang::txt('PLG_VOTE_RATE') . '" />';
             $html .= '<input type="hidden" name="task" value="article.vote" />';
             $html .= '<input type="hidden" name="hitcount" value="0" />';
             $html .= '<input type="hidden" name="url" value="' . htmlspecialchars($uri->toString()) . '" />';
             $html .= Html::input('token');
             $html .= '</div>';
             $html .= '</form>';
         }
     }
     return $html;
 }
Пример #10
0
    /**
     * Initialise the captcha
     *
     * @param   string   $id  The id of the field.
     * @return  boolean  True on success, false otherwise
     * @since   2.5
     */
    public function onInit($id)
    {
        // Initialise variables
        $lang = $this->_getLanguage();
        $pubkey = $this->params->get('public_key', '');
        $theme = $this->params->get('theme', 'clean');
        if ($pubkey == null || $pubkey == '') {
            throw new Exception(Lang::txt('PLG_RECAPTCHA_ERROR_NO_PUBLIC_KEY'));
        }
        $server = self::RECAPTCHA_API_SERVER;
        if (Request::isSecure()) {
            $server = self::RECAPTCHA_API_SECURE_SERVER;
        }
        Html::asset('script', $server . '/js/recaptcha_ajax.js');
        Document::addScriptDeclaration('jQuery(document).ready(function($) {
			Recaptcha.create("' . $pubkey . '", "dynamic_recaptcha_1", {theme: "' . $theme . '",' . $lang . 'tabindex: 0});
		});');
        return true;
    }
Пример #11
0
 /**
  * Display an edit icon for the article.
  *
  * This icon will not display in a popup window, nor if the article is trashed.
  * Edit access checks must be performed in the calling code.
  *
  * @param	object	$article	The article in question.
  * @param	object	$params		The article parameters
  * @param	array	$attribs	Not used??
  *
  * @return	string	The HTML for the article edit icon.
  * @since	1.6
  */
 static function edit($article, $params, $attribs = array())
 {
     // Initialise variables.
     $userId = User::get('id');
     // Ignore if in a popup window.
     if ($params && $params->get('popup')) {
         return;
     }
     // Ignore if the state is negative (trashed).
     if ($article->state < 0) {
         return;
     }
     Html::behavior('tooltip');
     // Show checked_out icon if the article is checked out by a different user
     if (property_exists($article, 'checked_out') && property_exists($article, 'checked_out_time') && $article->checked_out > 0 && $article->checked_out != User::get('id')) {
         $checkoutUser = User::getInstance($article->checked_out);
         $button = Html::asset('image', 'checked_out.png', NULL, NULL, true);
         $date = Date::of($article->checked_out_time)->toLocal();
         $tooltip = Lang::txt('JLIB_HTML_CHECKED_OUT') . ' :: ' . Lang::txt('COM_CONTENT_CHECKED_OUT_BY', $checkoutUser->name) . ' <br /> ' . $date;
         return '<span class="hasTip" title="' . htmlspecialchars($tooltip, ENT_COMPAT, 'UTF-8') . '">' . $button . '</span>';
     }
     $url = 'index.php?option=com_content&task=article.edit&a_id=' . $article->id . '&return=' . base64_encode(urlencode(Request::current(true)));
     $icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
     if (strtotime($article->publish_up) > strtotime(Date::of('now'))) {
         $icon = 'edit_unpublished.png';
     }
     $text = Lang::txt('JGLOBAL_EDIT');
     //Html::asset('image', $icon, Lang::txt('JGLOBAL_EDIT'), NULL, true);
     if ($article->state == 0) {
         $overlib = Lang::txt('JUNPUBLISHED');
     } else {
         $overlib = Lang::txt('JPUBLISHED');
     }
     $date = Date::of($article->created)->toLocal();
     $author = $article->created_by_alias ? $article->created_by_alias : $article->author;
     $overlib .= '&lt;br /&gt;';
     $overlib .= $date;
     $overlib .= '&lt;br /&gt;';
     $overlib .= Lang::txt('COM_CONTENT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8'));
     $button = '<a href="' . Route::url($url) . '">' . $text . '</a>';
     $output = '<span class="hasTip" title="' . Lang::txt('COM_CONTENT_EDIT_ITEM') . ' :: ' . $overlib . '">' . $button . '</span>';
     return $output;
 }
Пример #12
0
 /**
  * Display the thumb for the template.
  *
  * @param	string	The name of the active view.
  */
 public static function thumb($template, $clientId = 0)
 {
     $client = JApplicationHelper::getClientInfo($clientId);
     $basePath = $client->path . '/templates/' . $template;
     $baseUrl = $clientId == 0 ? Request::root(true) : Request::root(true) . '/administrator';
     $thumb = $basePath . '/template_thumbnail.png';
     $preview = $basePath . '/template_preview.png';
     $html = '';
     if (file_exists($thumb)) {
         $clientPath = $clientId == 0 ? '' : 'administrator/';
         $thumb = $clientPath . 'templates/' . $template . '/template_thumbnail.png';
         $html = Html::asset('image', $thumb, Lang::txt('COM_TEMPLATES_PREVIEW'));
         if (file_exists($preview)) {
             $preview = $baseUrl . '/templates/' . $template . '/template_preview.png';
             $html = '<a href="' . $preview . '" class="modal" title="' . Lang::txt('COM_TEMPLATES_CLICK_TO_ENLARGE') . '">' . $html . '</a>';
         }
     }
     return $html;
 }
Пример #13
0
 function display($tpl = null)
 {
     $config = Component::params('com_media');
     $style = Request::getState('media.list.layout', 'layout', 'thumbs', 'word');
     Document::setBuffer($this->loadTemplate('navigation'), 'modules', 'submenu');
     Html::behavior('framework', true);
     \Hubzero\Document\Assets::addComponentScript('com_media', 'mediamanager.js');
     \Hubzero\Document\Assets::addComponentStylesheet('com_media', 'mediamanager.css');
     Html::behavior('modal');
     Document::addScriptDeclaration("\n\t\tjQuery(document).ready(function(\$){\n\t\t\tdocument.preview = \$.fancybox;\n\t\t});");
     Html::asset('script', 'system/jquery.treeview.js', true, true, false, false);
     Html::asset('stylesheet', 'system/jquery.treeview.css', array(), true);
     if (Lang::isRTL()) {
         Html::asset('stylesheet', 'media/jquery.treeview_rtl.css', array(), true);
     }
     if (DIRECTORY_SEPARATOR == '\\') {
         $base = str_replace(DIRECTORY_SEPARATOR, "\\\\", COM_MEDIA_BASE);
     } else {
         $base = COM_MEDIA_BASE;
     }
     $js = "\n\t\t\tvar basepath = '" . $base . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t";
     Document::addScriptDeclaration($js);
     // Display form for FTP credentials?
     // Don't set them here, as there are other functions called before this one if there is any file write operation
     $ftp = !JClientHelper::hasCredentials('ftp');
     $session = App::get('session');
     $state = $this->get('state');
     $this->assignRef('session', $session);
     $this->assignRef('config', $config);
     $this->assignRef('state', $state);
     $this->require_ftp = $ftp;
     $this->folders_id = ' id="media-tree"';
     $this->folders = $this->get('folderTree');
     // Set the toolbar
     $this->addToolbar();
     parent::display($tpl);
     echo Html::behavior('keepalive');
 }
Пример #14
0
echo $this->item->type;
?>
	</td>
	<td class="center">
		<?php 
if (!$this->item->element) {
    ?>
		<strong>X</strong>
		<?php 
} else {
    ?>
		<a href="<?php 
    echo Route::url('index.php?option=com_installer&type=manage&task=' . $this->item->task . '&eid[]=' . $this->item->extension_id . '&limitstart=' . $this->pagination->limitstart . '&' . Session::getFormToken() . '=1');
    ?>
"><?php 
    echo Html::asset('image', 'images/' . $this->item->img, $this->item->alt, array('title' => $this->item->action));
    ?>
</a>
		<?php 
}
?>
	</td>
	<td class="center"><?php 
echo @$this->item->folder != '' ? $this->item->folder : 'N/A';
?>
</td>
	<td class="center"><?php 
echo @$this->item->client != '' ? $this->item->client : 'N/A';
?>
</td>
	<td>
Пример #15
0
?>
/templates/<?php 
echo $this->template;
?>
/html/mod_reportproblems/mod_reportproblems.css" />

		<script type="text/javascript" src="<?php 
echo \Html::asset('script', 'jquery.js', false, true, true);
?>
"></script>
		<script type="text/javascript" src="<?php 
echo \Html::asset('script', 'jquery.ui.js', false, true, true);
?>
"></script>
		<script type="text/javascript" src="<?php 
echo \Html::asset('script', 'jquery.fancybox.js', false, true, true);
?>
"></script>
		<script type="text/javascript" src="<?php 
echo $this->baseurl;
?>
/templates/<?php 
echo $this->template;
?>
/js/hub.js"></script>
		<script type="text/javascript" src="<?php 
echo $this->baseurl;
?>
/modules/mod_reportproblems/mod_reportproblems.js"></script>
	</head>
	<body>
Пример #16
0
						<?php 
        } elseif ($canChange) {
            ?>
							<a href="<?php 
            echo Route::url('index.php?option=com_menus&task=items.unsetDefault&cid[]=' . $item->id . '&' . Session::getFormToken() . '=1');
            ?>
">
								<?php 
            echo Html::asset('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => Lang::txt('COM_MENUS_GRID_UNSET_LANGUAGE', $item->language_title)), true);
            ?>
							</a>
						<?php 
        } else {
            ?>
							<?php 
            echo Html::asset('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true);
            ?>
						<?php 
        }
        ?>
					<?php 
    }
    ?>
				</td>
				<?php 
    $assoc = isset($app->menu_associations) ? $app->menu_associations : 0;
    if ($assoc) {
        ?>
				<td class="center">
					<?php 
        if ($item->association) {
Пример #17
0
 * @author    Shawn Rice <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
// no direct access
defined('_HZEXEC_') or die;
?>
<a href="<?php 
echo $link;
?>
" class="syndicate-module<?php 
echo $moduleclass_sfx;
?>
">
	<?php 
echo Html::asset('image', 'assets/livemarks.png', 'feed-image', NULL, true);
?>
	<?php 
if ($params->get('display_text', 1)) {
    ?>
		<span>
		<?php 
    if (str_replace(' ', '', $text) != '') {
        ?>
			<?php 
        echo $text;
        ?>
		<?php 
    } else {
        ?>
			<?php 
Пример #18
0
?>
</title>

		<!-- Styles -->
		<link rel="stylesheet" href="<?php 
echo $this->baseurl . '/templates/' . $this->template;
?>
/css/normalize.min.css" />
		<link rel="stylesheet" href="<?php 
echo $this->baseurl . '/templates/' . $this->template;
?>
/css/main.css" />

		<!-- Scripts -->
		<script type="text/javascript" src="<?php 
echo Html::asset('script', 'jquery.js', false, true, true);
?>
"></script>
		<script type="text/javascript" src="<?php 
echo $this->baseurl . '/templates/' . $this->template;
?>
/js/vendor/modernizr-2.6.2.min.js"></script>
		<script type="text/javascript" src="<?php 
echo $this->baseurl . '/templates/' . $this->template;
?>
/js/vendor/skrollr.min.js"></script>
		<script type="text/javascript" src="<?php 
echo $this->baseurl . '/templates/' . $this->template;
?>
/js/main.js"></script>
Пример #19
0
			<img src="images/joomla_logo_black.jpg" alt="Joomla! Logo" align="middle" />
			<h1>
				<?php 
echo Config::get('sitename');
?>
			</h1>
			<p>
				<?php 
echo Config::get('offline_message');
?>
			</p>
<?php 
if (Plugin::isEnabled('authentication', 'openid')) {
    ?>
			<?php 
    Html::asset('script', 'openid.js');
}
?>
			<form action="index.php" method="post" name="login" id="form-login">
				<fieldset class="input">
					<p id="form-login-username">
						<label for="username"><?php 
echo Lang::txt('Username');
?>
</label><br />
						<input name="username" id="username" type="text" class="inputbox" alt="<?php 
echo Lang::txt('Username');
?>
" size="18" />
					</p>
					<p id="form-login-password">
Пример #20
0
$params = new \Hubzero\Config\Registry();
$this->_tmp_img->name = ltrim($this->_tmp_img->name, DS);
$this->_tmp_img->title = ltrim($this->_tmp_img->title, DS);
Event::trigger('onContentBeforeDisplay', array('com_media.file', &$this->_tmp_img, &$params));
?>
		<tr>
			<td>
				<a class="img-preview" href="<?php 
echo COM_MEDIA_BASEURL . '/' . $this->_tmp_img->path_relative;
?>
" title="<?php 
echo $this->_tmp_img->name;
?>
">
					<?php 
echo Html::asset('image', COM_MEDIA_BASEURL . '/' . $this->_tmp_img->path_relative, Lang::txt('COM_MEDIA_IMAGE_TITLE', $this->_tmp_img->title, MediaHelper::parseSize($this->_tmp_img->size)), array('width' => $this->_tmp_img->width_16, 'height' => $this->_tmp_img->height_16));
?>
				</a>
			</td>
			<td class="description">
				<a href="<?php 
echo COM_MEDIA_BASEURL . '/' . $this->_tmp_img->path_relative;
?>
" title="<?php 
echo $this->_tmp_img->name;
?>
" rel="preview"><?php 
echo $this->escape($this->_tmp_img->title);
?>
</a>
				<br /><span><?php 
Пример #21
0
 * @license   http://opensource.org/licenses/MIT MIT
 */
// no direct access
defined('_HZEXEC_') or die;
?>
<div class="random-image<?php 
echo $moduleclass_sfx;
?>
">
	<?php 
if ($link) {
    ?>
		<a href="<?php 
    echo $link;
    ?>
">
	<?php 
}
?>
			<?php 
echo Html::asset('image', $image->folder . '/' . $image->name, $image->name, array('width' => $image->width, 'height' => $image->height));
?>
	<?php 
if ($link) {
    ?>
		</a>
	<?php 
}
?>
</div>
Пример #22
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     // Initialise variables.
     $extension = Request::getCmd('extension');
     $userId = User::get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     // Avoid nonsense situation.
     if ($extension == 'com_categories') {
         return;
     }
     // The extension can be in the form com_foo.section
     $parts = explode('.', $extension);
     $component = $parts[0];
     $section = count($parts) > 1 ? $parts[1] : null;
     // Need to load the menu language file as mod_menu hasn't been loaded yet.
     $lang = Lang::getRoot();
     $lang->load($component, JPATH_BASE, null, false, false) || $lang->load($component, PATH_CORE . '/components/' . $component . '/admin', null, false, false) || $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load($component, PATH_CORE . '/components/' . $component . '/admin', $lang->getDefault(), false, false);
     // Load the category helper.
     require_once JPATH_COMPONENT . '/helpers/categories.php';
     // Get the results for each action.
     $canDo = CategoriesHelper::getActions($component, $this->item->id);
     // If a component categories title string is present, let's use it.
     if ($lang->hasKey($component_title_key = $component . ($section ? "_{$section}" : '') . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE')) {
         $title = Lang::txt($component_title_key);
     } elseif ($lang->hasKey($component_section_key = $component . ($section ? "_{$section}" : ''))) {
         $title = Lang::txt('COM_CATEGORIES_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE', $this->escape(Lang::txt($component_section_key)));
     } else {
         $title = Lang::txt('COM_CATEGORIES_CATEGORY_BASE_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE');
     }
     // Load specific css component
     Html::asset('stylesheet', $component . '/administrator/categories.css', array(), true);
     // Prepare the toolbar.
     Toolbar::title($title, 'category-' . ($isNew ? 'add' : 'edit') . ' ' . substr($component, 4) . ($section ? "-{$section}" : '') . '-category-' . ($isNew ? 'add' : 'edit'));
     // For new records, check the create permission.
     if ($isNew && count(User::getAuthorisedCategories($component, 'core.create')) > 0) {
         Toolbar::apply('category.apply');
         Toolbar::save('category.save');
         Toolbar::save2new('category.save2new');
     } elseif (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_user_id == $userId)) {
         Toolbar::apply('category.apply');
         Toolbar::save('category.save');
         if ($canDo->get('core.create')) {
             Toolbar::save2new('category.save2new');
         }
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         Toolbar::save2copy('category.save2copy');
     }
     if (empty($this->item->id)) {
         Toolbar::cancel('category.cancel');
     } else {
         Toolbar::cancel('category.cancel', 'JTOOLBAR_CLOSE');
     }
     Toolbar::divider();
     // Compute the ref_key if it does exist in the component
     if (!$lang->hasKey($ref_key = strtoupper($component . ($section ? "_{$section}" : '')) . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_HELP_KEY')) {
         $ref_key = 'JHELP_COMPONENTS_' . strtoupper(substr($component, 4) . ($section ? "_{$section}" : '')) . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT');
     }
     // Get help for the category/section view for the component by
     // -remotely searching in a language defined dedicated URL: *component*_HELP_URL
     // -locally  searching in a component help file if helpURL param exists in the component and is set to ''
     // -remotely searching in a component URL if helpURL param exists in the component and is NOT set to ''
     if ($lang->hasKey($lang_help_url = strtoupper($component) . '_HELP_URL')) {
         $debug = $lang->setDebug(false);
         $url = Lang::txt($lang_help_url);
         $lang->setDebug($debug);
     } else {
         $url = null;
     }
     Toolbar::help('category');
     //$ref_key, Component::params( $component )->exists('helpURL'), $url, $component);
 }
Пример #23
0
$filterstring .= $this->filters['category'] ? '&amp;category=' . $this->filters['category'] : '';
for ($i = 0, $n = count($this->rows); $i < $n; $i++) {
    $row = $this->rows[$i];
    // Build some publishing info
    $info = Lang::txt('COM_PUBLICATIONS_FIELD_CREATED') . ': ' . $row->created . '<br />';
    $info .= Lang::txt('COM_PUBLICATIONS_FIELD_CREATOR') . ': ' . $this->escape($row->created_by) . '<br />';
    // Get the published status
    $now = Date::toSql();
    // See if it's checked out or not
    $checked = '';
    $checkedInfo = '';
    if ($row->checked_out || $row->checked_out_time != '0000-00-00 00:00:00') {
        $date = Date::of($row->checked_out_time)->toLocal(Lang::txt('DATE_FORMAT_LC1'));
        $time = Date::of($row->checked_out_time)->toLocal('H:i');
        $checked = '<span class="editlinktip hasTip" title="' . Lang::txt('JLIB_HTML_CHECKED_OUT') . '::' . $this->escape($row->checked_out) . '<br />' . $date . '<br />' . $time . '">';
        $checked .= Html::asset('image', 'admin/checked_out.png', null, null, true) . '</span>';
        $info .= $row->checked_out_time != '0000-00-00 00:00:00' ? Lang::txt('COM_PUBLICATIONS_FIELD_CHECKED_OUT') . ': ' . $date . '<br />' : '';
        $info .= $row->checked_out ? Lang::txt('COM_PUBLICATIONS_FIELD_CHECKED_OUT_BY') . ': ' . $row->checked_out . '<br />' : '';
        $checkedInfo = ' [' . Lang::txt('COM_PUBLICATIONS_FIELD_CHECKED_OUT') . ']';
    } else {
        $checked = Html::grid('id', $i, $row->id, false, 'id');
    }
    // What's the publication status?
    $status = $this->model->getStatusName($row->state);
    $class = $this->model->getStatusCss($row->state);
    $date = $row->modified() ? $row->modified('datetime') : $row->created('datetime');
    ?>
			<tr class="<?php 
    echo "row{$k}";
    ?>
 <?php 
Пример #24
0
echo substr(PATH_APP, strlen(PATH_ROOT)) . "/" . ltrim($params->get('image_path', 'images'), "/");
?>
/';
</script>
<h2 class="modal-title"><?php 
echo Lang::txt('COM_MEDIA');
?>
</h2>

<form action="<?php 
echo Route::url('index.php?option=com_media&asset=' . Request::getCmd('asset') . '&author=' . Request::getCmd('author'));
?>
" id="imageForm" method="post" enctype="multipart/form-data">
	<div id="messages" style="display: none;">
		<span id="message"></span><?php 
echo Html::asset('image', 'media/dots.gif', '...', array('width' => 22, 'height' => 12), true);
?>
	</div>
	<fieldset class="image-controls">
		<div class="fltlft">
			<label for="folder"><?php 
echo Lang::txt('COM_MEDIA_DIRECTORY');
?>
</label>
			<?php 
echo $this->folderList;
?>
			<button type="button" id="upbutton" title="<?php 
echo Lang::txt('COM_MEDIA_DIRECTORY_UP');
?>
"><?php 
Пример #25
0
							<?php 
            }
            ?>
						</td>
						<td class="center">
							<?php 
            if (!array_key_exists($contentlang->lang_code, $this->homepages)) {
                ?>
								<?php 
                echo Html::asset('image', 'menu/icon-16-notice.png', Lang::txt('NOTICE'), NULL, true);
                ?>
							<?php 
            } else {
                ?>
								<?php 
                echo Html::asset('image', 'admin/tick.png', Lang::txt('JON'), NULL, true);
                ?>
							<?php 
            }
            ?>
						</td>
				<?php 
        }
        ?>
			<?php 
    }
    ?>
			</tr>
		</tbody>
	</table>
	<?php