public function display($tpl = null)
 {
     $state = $this->get('State');
     $params = $state->get('params');
     $this->state = $state;
     $this->params = $params;
     $item = $this->get('Item');
     $this->image = null;
     if ($item) {
         if ($media = $item->media) {
             if (isset($media->image)) {
                 $image = clone $media->image;
                 if (isset($image->url) && $image->url) {
                     if ($size = $params->get('mt_image_related_size', 'o')) {
                         if (isset($image->url) && !empty($image->url)) {
                             $image_url_ext = JFile::getExt($image->url);
                             $image_url = str_replace('.' . $image_url_ext, '_' . $size . '.' . $image_url_ext, $image->url);
                             $image->related_url = JURI::root() . $image_url;
                         }
                     }
                     if ($params->get('mt_image_use_cloud', 1)) {
                         $doc = JFactory::getDocument();
                         if (!$this->head) {
                             $doc->addStyleSheet(TZ_Portfolio_PlusUri::base(true) . '/addons/mediatype/image/css/cloud-zoom.min.css');
                             $doc->addScript(TZ_Portfolio_PlusUri::base(true) . '/addons/mediatype/image/js/cloud-zoom.1.0.3.min.js');
                             $this->head = true;
                         }
                         if ($params->get('mt_image_cloud_size', 'o')) {
                             $image_url_ext = JFile::getExt($image->url);
                             $image_url = str_replace('.' . $image_url_ext, '_' . $params->get('mt_image_cloud_size', 'o') . '.' . $image_url_ext, $image->url);
                             $image->url_cloud_zoom = JURI::root() . $image_url;
                         }
                     }
                     if ($size = $params->get('mt_image_size', 'o')) {
                         if (isset($image->url) && !empty($image->url)) {
                             $image_url_ext = JFile::getExt($image->url);
                             $image_url = str_replace('.' . $image_url_ext, '_' . $size . '.' . $image_url_ext, $image->url);
                             $image->url = JURI::root() . $image_url;
                             if ($this->getLayout() != 'related') {
                                 JFactory::getDocument()->addCustomTag('<meta property="og:image" content="' . $image->url . '"/>');
                                 if ($author = $item->author_info) {
                                     JFactory::getDocument()->setMetaData('twitter:image', $image->url);
                                 }
                             }
                         }
                         if (isset($image->url_hover) && !empty($image->url_hover)) {
                             $image_url_ext = JFile::getExt($image->url_hover);
                             $image_url = str_replace('.' . $image_url_ext, '_' . $size . '.' . $image_url_ext, $image->url_hover);
                             $image->url_hover = JURI::root() . $image_url;
                         }
                     }
                     $this->image = $image;
                 }
             }
         }
         $this->item = $item;
     }
     parent::display($tpl);
 }
    /**
     * Method to display a view.
     *
     * @param	boolean			If true, the view output will be cached
     * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
     *
     * @return	JController		This object to support chaining.
     * @since	1.5
     */
    public function display($cachable = false, $urlparams = false)
    {
        //        JFactory::getLanguage() -> load('com_content');
        $app = JFactory::getApplication('site');
        $doc = JFactory::getDocument();
        $params = $app->getParams();
        $cachable = true;
        JHtml::_('behavior.caption');
        // Set the default view name and format from the Request.
        // Note we are using a_id to avoid collisions with the router and the return page.
        // Frontend is a bit messier than the backend.
        $id = $this->input->get('a_id');
        $vName = $this->input->get('view', 'portfolio');
        $this->input->set('view', $vName);
        $user = JFactory::getUser();
        $safeurlparams = array('catid' => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT', 'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN', 'lang' => 'CMD', 'Itemid' => 'INT');
        // Check for edit form.
        if ($vName == 'form' && !$this->checkEditId('com_tz_portfolio_plus.edit.article', $id)) {
            // Somehow the person just went to the form - we don't allow that.
            return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
        }
        //Add Script to the header
        if ($params->get('enable_jquery', 0)) {
            $doc->addScript(TZ_Portfolio_PlusUri::base(true) . '/js/jquery-1.11.3.min.js');
            $doc->addScript(TZ_Portfolio_PlusUri::base(true) . '/js/jquery-noconflict.min.js');
            $doc->addScript(TZ_Portfolio_PlusUri::base(true) . '/js/jquery-migrate-1.2.1.js');
        }
        if ($params->get('enable_bootstrap', 1)) {
            $doc->addScript(TZ_Portfolio_PlusUri::base(true) . '/bootstrap/js/bootstrap.min.js');
            $doc->addStyleSheet(TZ_Portfolio_PlusUri::base(true) . '/bootstrap/css/bootstrap.min.css');
            $doc->addScriptDeclaration('
				(function($){
					$(document).off(\'click.modal.data-api\')
					.on(\'click.modal.data-api\', \'[data-toggle="modal"]\', function (e) {
						var $this = $(this)
						  , href = $this.attr(\'href\')
						  , $target = $($this.attr(\'data-target\') || (href && href.replace(/.*(?=#[^\\s]+$)/, \'\'))) //strip for ie7
						  , option = $target.data(\'modal\') ? \'toggle\' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
					
						e.preventDefault();
					
						$target
						  .modal(option)
						  .one(\'hide\', function () {
							$this.focus()
						  });
					  });
				})(jQuery);
			');
        }
        parent::display($cachable, $safeurlparams);
        return $this;
    }
 public function display($tpl = null)
 {
     $this->item = $this->get('Item');
     $state = $this->get('State');
     $params = $state->get('params');
     $this->params = $params;
     if (!$this->head) {
         $document = JFactory::getDocument();
         $document->addStyleSheet(TZ_Portfolio_PlusUri::root(true) . '/addons/content/vote/css/vote.css');
         $document->addScript(TZ_Portfolio_PlusUri::root(true) . '/addons/content/vote/js/vote.js');
         $document->addScriptDeclaration('var tzPortfolioVoteFolder = "' . TZ_Portfolio_PlusUri::base(true) . '";
     var tzPortfolioPlusBase = "' . TZ_Portfolio_PlusUri::base(true) . '/addons/content/vote";
     var TzPortfolioPlusVote_text=Array("' . JTEXT::_('PLG_CONTENT_VOTE_NO_AJAX') . '","' . JTEXT::_('PLG_CONTENT_VOTE_LOADING') . '","' . JTEXT::_('PLG_CONTENT_VOTE_THANKS') . '","' . JTEXT::_('PLG_CONTENT_VOTE_LOGIN') . '","' . JTEXT::_('PLG_CONTENT_VOTE_RATED') . '","' . JTEXT::_('PLG_CONTENT_VOTE_VOTES') . '","' . JTEXT::_('PLG_CONTENT_VOTE_VOTE') . '");');
         $this->head = true;
     }
     parent::display($tpl);
 }
 public function display($tpl = null)
 {
     $state = $this->get('State');
     $params = $state->get('params');
     $this->params = $params;
     $item = $this->get('Item');
     $this->image = null;
     if ($item) {
         if ($media = $item->media) {
             if (isset($media->image)) {
                 $image = clone $media->image;
                 if (isset($image->url) && $image->url) {
                     if (!$this->head) {
                         $doc = JFactory::getDocument();
                         $doc->addStyleSheet(TZ_Portfolio_PlusUri::base() . '/addons/mediatype/image/css/style.css');
                         $this->head = true;
                     }
                     $image->temp = $image->url;
                     if ($size = $params->get('mt_cat_image_size', 'o')) {
                         if (isset($image->url) && !empty($image->url)) {
                             $image_url_ext = JFile::getExt($image->url);
                             $image_url = str_replace('.' . $image_url_ext, '_' . $size . '.' . $image_url_ext, $image->url);
                             $image->url = JURI::root() . $image_url;
                         }
                         if (isset($image->url_hover) && !empty($image->url_hover)) {
                             $image_url_ext = JFile::getExt($image->url_hover);
                             $image_url = str_replace('.' . $image_url_ext, '_' . $size . '.' . $image_url_ext, $image->url_hover);
                             $image->url_hover = JURI::root() . $image_url;
                         }
                     }
                     $this->image = $image;
                 }
             }
         }
         $this->item = $item;
     }
     parent::display($tpl);
 }
 public static function sortable($tableId, $formId, $sortDir = 'asc', $saveOrderingUrl = null, $proceedSaveOrderButton = true, $nestedList = false)
 {
     // Only load once
     if (isset(static::$loaded[__METHOD__])) {
         return;
     }
     // Note: $i is required but has to be an optional argument in the function call due to argument order
     if (null === $saveOrderingUrl) {
         throw new InvalidArgumentException('$saveOrderingUrl is a required argument in JHtmlSortablelist::sortable');
     }
     // Depends on jQuery UI
     JHtml::_('jquery.ui', array('core', 'sortable'));
     JHtml::_('script', TZ_Portfolio_PlusUri::base(false, true) . '/js/sortablelist.min.js', false, true);
     JHtml::_('stylesheet', 'jui/sortablelist.css', false, true, false);
     // Attach sortable to document
     JFactory::getDocument()->addScriptDeclaration("\n\t\t\t(function (\$){\n\t\t\t\t\$(document).ready(function (){\n\t\t\t\t\tvar sortableList = new \$.TZPortfolioPlusSortableList('#" . $tableId . " tbody','" . $formId . "','" . $sortDir . "' , '" . $saveOrderingUrl . "','','" . $nestedList . "');\n\t\t\t\t});\n\t\t\t})(jQuery);\n\t\t\t");
     if ($proceedSaveOrderButton) {
         static::_proceedSaveOrderButton();
     }
     // Set static array
     static::$loaded[__METHOD__] = true;
     return;
 }
<?php

/*------------------------------------------------------------------------

# TZ Portfolio Plus Extension

# ------------------------------------------------------------------------

# author    DuongTVTemPlaza

# copyright Copyright (C) 2015 templaza.com. All Rights Reserved.

# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL

# Websites: http://www.templaza.com

# Technical Support:  Forum - http://templaza.com/Forum

-------------------------------------------------------------------------*/
// No direct access
defined('_JEXEC') or die;
if (!$this->params->get('load_style', 0)) {
    $doc = JFactory::getDocument();
    $tpl_path = TZ_Portfolio_PlusUri::base(true) . '/templates/system/css/template.css';
    unset($this->_styleSheets[$tpl_path]);
}
# author    DuongTVTemPlaza

# copyright Copyright (C) 2015 templaza.com. All Rights Reserved.

# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL

# Websites: http://www.templaza.com

# Technical Support:  Forum - http://templaza.com/Forum

-------------------------------------------------------------------------*/
// No direct access.
defined('_JEXEC') or die;
if ($item && $image && isset($image->url) && !empty($image->url)) {
    $doc = JFactory::getDocument();
    $doc->addStyleSheet(TZ_Portfolio_PlusUri::base() . '/addons/mediatype/image/css/style.css');
    if ($params->get('mt_show_image', 1)) {
        ?>
<div class="tz_portfolio_plus_image">
    <a href="<?php 
        echo $item->link;
        ?>
">
        <img src="<?php 
        echo $image->url;
        ?>
"
             alt="<?php 
        echo isset($image->caption) ? $image->caption : $item->title;
        ?>
"
    public function getInputDefault($group = null)
    {
        $this->group = $group ? $group : $this->group;
        $fieldValues = $this->getFieldValues();
        if ($this->getAttribute("type", "", "input") == "") {
            $this->setAttribute("type", "text", "input");
        }
        $this->setVariable('value', $fieldValues);
        if ($html = $this->loadTmplFile('input_default', __CLASS__)) {
            return $html;
        }
        $input_def_path = COM_TZ_PORTFOLIO_PLUS_ADDON_PATH . DIRECTORY_SEPARATOR . 'extrafields' . DIRECTORY_SEPARATOR . $this->fieldname . DIRECTORY_SEPARATOR . 'tmpl' . DIRECTORY_SEPARATOR . 'input_default.php';
        if (JFile::exists($input_def_path)) {
            ob_start();
            require_once $input_def_path;
            $html = ob_get_contents();
            ob_end_clean();
        } else {
            if ($this->multiple_option) {
                $default_type = 'radio';
                if ($this->multiple) {
                    $default_type = 'checkbox';
                }
                if (!$this->head) {
                    $id_head_text = $this->formcontrol . '_' . ($group ? $group : $this->group) . '_$i_text';
                    $html = '<tr>';
                    $html .= '<td class="center"><i class="icon-menu" style="cursor: move;"></i></td>';
                    $html .= '<td><input type="text" name="' . $this->formcontrol . '[' . ($group ? $group : $this->group) . '][$i][text]" id="' . $id_head_text . '" class="input-medium required"' . ' required="" size="35"/>' . '<label id="' . $id_head_text . '-lbl" class="required" for="' . $id_head_text . '" style="display: none;">' . JText::_('COM_TZ_PORTFOLIO_PLUS_OPTION_FIELD_VALUE_LABEL') . '</label></td>';
                    $html .= '<td><input type="text" name="' . $this->formcontrol . '[' . ($group ? $group : $this->group) . '][$i][value]" class="input-mini" size="15"/></td>';
                    $html .= '<td class="center">';
                    if ($this->multiple) {
                        $html .= '<input type="checkbox" name="' . $this->formcontrol . '[' . ($group ? $group : $this->group) . '][$i][default]" value="1"/>';
                    } else {
                        $html .= '<input type="radio" name="' . $this->formcontrol . '[' . ($group ? $group : $this->group) . '][default]" value="$i"/>';
                    }
                    $html .= '</td>';
                    //                    $html           .= '<td class="center"><input type="checkbox" name="'.$this -> formcontrol.'['
                    //                                        .($group?$group:$this -> group).'][$i][disabled]" value="1"/></td>';
                    $html .= '<td><button type="button" class="btn btn-danger btn-mini tz_remove-option"><i class="icon-minus"></i>';
                    $html .= JText::_('COM_TZ_PORTFOLIO_PLUS_REMOVE') . '</button></td>';
                    $html .= '</tr>';
                    $doc = JFactory::getDocument();
                    $doc->addScript(TZ_Portfolio_PlusUri::base(true, true) . '/js/jquery-ui.min.js');
                    $doc->addStyleDeclaration('#jform_' . $group . ' .table{
                        margin-top: 5px;
                    }');
                    $doc->addScriptDeclaration('
                    (function($){
                        $(document).ready(function(){
                            function tz_extrafields(){
                                var $i  = ' . ($fieldValues && count($fieldValues) ? count($fieldValues) : 0) . ';
                                function tzFieldRemove(){
                                    $("#jform_' . $group . ' .tz_remove-option").unbind("click").bind("click",function(e){
                                        $(this).parents("tr").first().remove();
                                    });
                                }
                                tzFieldRemove();
                                $("#jform_' . $group . ' .tz_add-option").on("click",function(e){
                                    var html    = "' . jsPlusAddSlashes($html) . '";
                                    $("#jform_' . $group . ' .table tbody").first().append(html.replace(/\\$i/mg, $i));
                                    tzFieldRemove();
                                    $i ++;
                                });
                                $("#jform_' . $group . ' .table tbody").sortable({
                                    handle: ".icon-menu",
                                    cursor: "move",
                                    items: "tr",
                                    axis: "y",
                                    placeholder: "ui-state-highlight",
                                    forcePlaceholderSize: true,
                                    forceHelperSize: true,
                                    distance: 2
                                    ,start: function(event,ui){
                                        $.each(ui.helper.find("td"),function(){
                                            $(this).width($(this).innerWidth());
                                        });
                                        $.each(ui.item.find("td"),function(){
                                            $(this).width($(this).innerWidth());
                                        });
                                    },
                                    stop: function(event,ui){
                                        ui.item.children().width("");
                                    }
                                });
                            }
                            tz_extrafields();

                        });
                    })(jQuery);
                    ');
                }
                $html = '<button type="button" class="btn btn-mini tz_add-option"><i class="icon-plus"></i>';
                $html .= JText::_('COM_TZ_PORTFOLIO_PLUS_ADD_AN_OPTION') . '</button>';
                $html .= '<table class="table table-striped table-bordered">';
                $html .= '<thead>';
                $html .= '<tr>';
                $html .= '<th>';
                $html .= JText::_('COM_TZ_PORTFOLIO_PLUS_SORT');
                $html .= '</th>';
                $html .= '<th>';
                $html .= JText::_('COM_TZ_PORTFOLIO_PLUS_FIELD_TEXT');
                $html .= '<span class="star">&nbsp;*</span>';
                $html .= '</th>';
                $html .= '<th>';
                $html .= JText::_('COM_TZ_PORTFOLIO_PLUS_VALUE');
                $html .= '</th>';
                $html .= '<th>';
                $html .= JText::_('JDEFAULT');
                $html .= '</th>';
                //                $html           .= '<th>';
                //                $html               .= JText::_('JDISABLED');
                //                $html           .= '</th>';
                $html .= '<th>';
                $html .= JText::_('JSTATUS');
                $html .= '</th>';
                $html .= '</tr>';
                $html .= '</thead>';
                $html .= '<tbody>';
                if ($fieldValues && !is_string($fieldValues)) {
                    foreach ($fieldValues as $key => $value) {
                        $name_text = $this->formcontrol . '[' . ($group ? $group : $this->group) . '][' . $key . '][text]';
                        $id_text = JApplicationHelper::stringURLSafe($name_text);
                        $id_text = preg_replace('#\\W#', '_', $id_text);
                        $name_value = $this->formcontrol . '[' . ($group ? $group : $this->group) . '][' . $key . '][value]';
                        $id_value = JApplicationHelper::stringURLSafe($name_value);
                        $id_value = preg_replace('#\\W#', '_', $id_value);
                        $html .= '<tr>';
                        $html .= '<td class="center"><i class="icon-menu" style="cursor: move;"></i></td>';
                        $html .= '<td><input type="text" id="' . $id_text . '" name="' . $this->formcontrol . '[' . ($group ? $group : $this->group) . '][' . $key . '][text]" required=""' . ' class="input-medium required" size="35" value="' . htmlspecialchars($value->text) . '"/>' . '<label id="' . $id_text . '-lbl" class="required" for="' . $id_text . '" style="display: none;">' . JText::_('COM_TZ_PORTFOLIO_PLUS_OPTION_FIELD_VALUE_LABEL') . '</label></td>';
                        $html .= '<td><input type="text" id="' . $id_value . '" name="' . $name_value . '"' . ' class="input-mini" size="15" value="' . htmlspecialchars($value->value) . '"/></td>';
                        $html .= '<td class="center">';
                        if ($this->multiple) {
                            $html .= '<input type="' . $default_type . '" name="' . $this->formcontrol . '[' . ($group ? $group : $this->group) . '][' . $key . '][default]"' . ' value="1"' . (isset($value->default) && $value->default == 1 ? 'checked="checked"' : '') . '/>';
                        } else {
                            $html .= '<input type="radio" name="' . $this->formcontrol . '[' . ($group ? $group : $this->group) . '][default]"' . ' value="' . $key . '"' . (isset($value->default) && $value->default == 1 ? 'checked="checked"' : '') . '/>';
                        }
                        $html .= '</td>';
                        //                        $html           .= '<td class="center"><input type="checkbox" name="'.$this -> formcontrol.'['
                        //                                            .($group?$group:$this -> group).']['.$key.'][disabled]"'
                        //                                            .' value="1"'.((isset($value ->disabled) && $value ->disabled == 1)
                        //                                            ?'checked="checked"':'').'/></td>';
                        $html .= '<td><button type="button" class="btn btn-danger btn-mini tz_remove-option"><i class="icon-minus"></i>';
                        $html .= JText::_('COM_TZ_PORTFOLIO_PLUS_REMOVE') . '</button></td>';
                        $html .= '</tr>';
                    }
                }
                $html .= '</tbody>';
                $html .= '</table>';
            } else {
                $html = '<input type="text" name="' . $this->formcontrol . '[' . ($group ? $group : $this->group) . ']"' . ' value="' . htmlspecialchars($this->getDefaultValues()) . '"/>';
            }
        }
        return $html;
    }
 public function parseDocument(&$view = null)
 {
     if ($view) {
         if (isset($view->document)) {
             if ($template = TZ_Portfolio_PlusTemplate::getTemplate(true)) {
                 if (JFolder::exists(COM_TZ_PORTFOLIO_PLUS_TEMPLATE_PATH . DIRECTORY_SEPARATOR . $template->template)) {
                     $docOptions['template'] = $template->template;
                     $docOptions['file'] = 'template.php';
                     $docOptions['params'] = $template->params;
                     $docOptions['directory'] = COM_TZ_PORTFOLIO_PLUS_PATH_SITE . DIRECTORY_SEPARATOR . 'templates';
                     // Add template.css file if it has have in template
                     if (JFile::exists(COM_TZ_PORTFOLIO_PLUS_TEMPLATE_PATH . DIRECTORY_SEPARATOR . $template->template . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'template.css')) {
                         $view->document->addStyleSheet(TZ_Portfolio_PlusUri::base(true) . '/templates/' . $template->template . '/css/template.css');
                     }
                     // Parse document of view to require template.php(in tz portfolio template) file.
                     $view->document->parse($docOptions);
                 }
                 return true;
             }
         }
         return false;
     }
     return false;
 }
Exemple #10
0
-------------------------------------------------------------------------*/
// No direct access.
defined('_JEXEC') or die;
// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
// Load the tooltip behavior.
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tabstate');
JHtml::_('formbehavior.chosen', 'select');
$doc = JFactory::getDocument();
$doc->addscript(TZ_Portfolio_PlusUri::base(true, true) . '/js/tz-chosen.min.js');
$doc->addScript(TZ_Portfolio_PlusUri::base(true, true) . '/js/jquery-ui.min.js');
$doc->addStyleSheet(TZ_Portfolio_PlusUri::base(true, true) . '/css/jquery-ui.min.css');
$doc->addStyleSheet(TZ_Portfolio_PlusUri::base(true, true) . '/css/tz_portfolio_plus.min.css');
if (!$this->tagsSuggest) {
    $this->tagsSuggest = 'null';
}
$doc->addScriptDeclaration('
    jQuery(document).ready(function(){
        jQuery(".suggest").tzChosen({ source: ' . $this->tagsSuggest . ', sourceEdit: ' . $this->listsTags . ',keys: ["\\,","/"]});
    })
');
// Create shortcut to parameters.
$params = $this->state->get('params');
//
$params = $params->toArray();
// This checks if the config options have ever been saved. If they haven't they will fall back to the original settings.
$editoroptions = isset($params['show_publishing_options']);
if (!$editoroptions) {
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     $canDo = TZ_Portfolio_PlusHelper::getActions($this->state->get('filter.category_id'));
     $user = JFactory::getUser();
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::title(JText::_('COM_TZ_PORTFOLIO_PLUS_ARTICLES_TITLE'), 'stack article');
     if ($canDo->get('core.create') || count($user->getAuthorisedCategories('com_tz_portfolio_plus', 'core.create')) > 0) {
         JToolBarHelper::addNew('article.add');
     }
     if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) {
         JToolBarHelper::editList('article.edit');
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::divider();
         JToolBarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::custom('articles.featured', 'featured.png', 'featured_f2.png', 'JFEATURED', true);
         JToolBarHelper::divider();
         JToolBarHelper::checkin('articles.checkin');
     }
     if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
         JToolBarHelper::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH');
         JToolBarHelper::divider();
     } elseif ($canDo->get('core.edit.state')) {
         JToolBarHelper::trash('articles.trash');
         JToolBarHelper::divider();
     }
     //         //Add a batch button
     //		if ($user->authorise('core.edit'))
     //		{
     //			JHtml::_('bootstrap.modal', 'collapseModal');
     //
     //            $title      = JText::_('JTOOLBAR_BATCH');
     //            $batchIcon  = '<i class="icon-checkbox-partial" title="'.$title.'"></i>';
     //            $batchClass = ' class="btn btn-small"';
     //
     //			$dhtml = '<a'.$batchClass.' href="#" data-toggle="modal" data-target="#collapseModal">';
     //            $dhtml .= $batchIcon.$title.'</a>';
     //
     //			$bar->appendButton('Custom', $dhtml, 'batch');
     //		}
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_tz_portfolio_plus');
         JToolBarHelper::divider();
     }
     $doc = JFactory::getDocument();
     // If the joomla is version 3.0
     $doc->addStyleSheet(TZ_Portfolio_PlusUri::base(true, true) . '/fonts/font-awesome-4.5.0/css/font-awesome.min.css');
     $doc->addStyleSheet(TZ_Portfolio_PlusUri::base(true, true) . '/css/style.min.css');
     JToolBarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER');
     // Special HTML workaround to get send popup working
     $docClass = ' class="btn btn-small"';
     $youtubeIcon = '<i class="tz-icon-youtube tz-icon-14"></i>&nbsp;';
     $wikiIcon = '<i class="tz-icon-wikipedia tz-icon-14"></i>&nbsp;';
     $youtubeTitle = JText::_('COM_TZ_PORTFOLIO_PLUS_VIDEO_TUTORIALS');
     $wikiTitle = JText::_('COM_TZ_PORTFOLIO_PLUS_WIKIPEDIA_TUTORIALS');
     $videoTutorial = '<a' . $docClass . ' onclick="Joomla.popupWindow(\'http://www.youtube.com/channel/UCykS6SX6L2GOI-n3IOPfTVQ/videos\', \'' . $youtubeTitle . '\', 800, 500, 1)"' . ' href="#">' . $youtubeIcon . $youtubeTitle . '</a>';
     $wikiTutorial = '<a' . $docClass . ' onclick="Joomla.popupWindow(\'http://wiki.templaza.com/Main_Page\', \'' . $wikiTitle . '\', 800, 500, 1)"' . ' href="#">' . $wikiIcon . $wikiTitle . '</a>';
     $bar->appendButton('Custom', $videoTutorial, 'youtube');
     $bar->appendButton('Custom', $wikiTutorial, 'wikipedia');
     JHtmlSidebar::setAction('index.php?option=com_tz_portfolio_plus&view=articles');
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived' => false)), 'value', 'text', $this->state->get('filter.published'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('tzcategory.options', 'com_tz_portfolio_plus'), 'value', 'text', $this->state->get('filter.category_id')));
     JHtmlSidebar::addFilter(JText::_('COM_TZ_PORTFOLIO_PLUS_OPTION_SELECT_MEDIA_TYPE'), 'filter_mediatype', JHtml::_('select.options', JHtml::_('mediatypes.options'), 'value', 'text', $this->state->get('filter.mediatype')));
     JHtmlSidebar::addFilter(JText::_('COM_TZ_PORTFOLIO_PLUS_OPTION_SELECT_FIELDS_GROUP'), 'filter_group', JHtml::_('select.options', JHtml::_('fieldgroups.options'), 'value', 'text', $this->state->get('filter.group')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_MAX_LEVELS'), 'filter_level', JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_AUTHOR'), 'filter_author_id', JHtml::_('select.options', $this->authors, 'value', 'text', $this->state->get('filter.author_id')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
 }