Пример #1
0
 public function display($tpl = null)
 {
     $this->option = JFactory::getApplication()->input->get('option');
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $categoryId = $this->state->get('filter.category_id');
     $this->category = new Userideas\Category\Category(JFactory::getDbo());
     $this->category->load($categoryId);
     if ($this->params->get('show_cat_tags', 0)) {
         $this->category->setTagsHelper(new JHelperTags());
         $this->tags = $this->category->getTags();
     }
     $this->comments = $this->get('Comments');
     $user = JFactory::getUser();
     $this->userId = $user->get('id');
     // Set permission state. Is it possible to be edited items?
     $this->canEdit = $user->authorise('core.edit.own', 'com_userideas');
     if (empty($this->category)) {
         $app = JFactory::getApplication();
         /** @var $app JApplicationSite */
         $app->enqueueMessage(JText::_('COM_USERIDEAS_ERROR_INVALID_CATEGORY'), 'notice');
         $app->redirect(JRoute::_('index.php', false));
         return;
     }
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     $this->commentsEnabled = $this->params->get('comments_enabled', 1);
     // Prepare integration. Load avatars and profiles.
     $this->prepareIntegration($this->params);
     $this->prepareDocument();
     parent::display($tpl);
 }
Пример #2
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     UserIdeasHelper::addSubmenu($this->getName());
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array("archived" => false, "trash" => false)), 'value', 'text', $this->state->get('filter.state'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Пример #3
0
 public function display($tpl = null)
 {
     $this->version = new UserIdeasVersion();
     // Load ITPrism library version
     jimport("itprism.version");
     if (!class_exists("ITPrismVersion")) {
         $this->itprismVersion = JText::_("COM_USERIDEAS_ITPRISM_LIBRARY_DOWNLOAD");
     } else {
         $itprismVersion = new ITPrismVersion();
         $this->itprismVersion = $itprismVersion->getShortVersion();
     }
     jimport("userideas.statistics.basic");
     $basic = new UserIdeasStatisticsBasic(JFactory::getDbo());
     $this->totalItems = $basic->getTotalItems();
     $this->totalVotes = $basic->getTotalVotes();
     $this->totalComments = $basic->getTotalComments();
     // Get popular items.
     jimport("userideas.statistics.items.popular");
     $this->popular = new UserIdeasStatisticsItemsPopular(JFactory::getDbo());
     $this->popular->load(5);
     // Get most voted items.
     jimport("userideas.statistics.items.mostvoted");
     $this->mostVoted = new UserIdeasStatisticsItemsMostVoted(JFactory::getDbo());
     $this->mostVoted->load(5);
     // Get latest items.
     jimport("userideas.statistics.items.latest");
     $this->latest = new UserIdeasStatisticsItemsLatest(JFactory::getDbo());
     $this->latest->load(5);
     // Add submenu
     UserIdeasHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Пример #4
0
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $categoryId = $this->state->get("filter.category_id");
     jimport("userideas.category");
     $this->category = new UserIdeasCategory(JFactory::getDbo());
     $this->category->load($categoryId);
     $this->comments = $this->get("Comments");
     $this->userId = JFactory::getUser()->get("id");
     if (empty($this->category)) {
         $app = JFactory::getApplication();
         /** @var $app JApplicationSite */
         $app->enqueueMessage(JText::_("COM_USERIDEAS_ERROR_INVALID_CATEGORY"), "notice");
         $app->redirect(JRoute::_('index.php', false));
         return;
     }
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     // Prepare integration. Load avatars and profiles.
     $this->prepareIntegration($this->params);
     $this->version = new UserIdeasVersion();
     $this->prepareDocument();
     parent::display($tpl);
 }
Пример #5
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     UserIdeasHelper::addSubmenu($this->getName());
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array("archived" => false, "trash" => false)), 'value', 'text', $this->state->get('filter.state'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category', JHtml::_('select.options', JHtml::_('category.options', 'com_userideas'), 'value', 'text', $this->state->get('filter.category'), true));
     // Item statuses
     $statuses = Userideas\Status\Statuses::getInstance(JFactory::getDbo());
     JHtmlSidebar::addFilter(JText::_('COM_USERIDEAS_SELECT_ITEM_STATUS'), 'filter_status', JHtml::_('select.options', $statuses->getStatusesOptions(), 'value', 'text', $this->state->get('filter.status'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Пример #6
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     // Add submenu
     UserIdeasHelper::addSubmenu($this->getName());
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
Пример #7
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $this->comments = $this->get("Comments");
     $this->userId = JFactory::getUser()->id;
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     // Prepare integration. Load avatars and profiles.
     $this->prepareIntegration($this->params);
     $this->version = new UserIdeasVersion();
     $this->prepareDocument();
     parent::display($tpl);
 }
Пример #8
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get('params');
     $this->comments = $this->get("Comments");
     $user = JFactory::getUser();
     $this->userId = $user->get("id");
     // Set permission state. Is it possible to be edited items?
     $this->canEdit = $user->authorise('core.edit.own', 'com_userideas');
     $this->items = UserIdeasHelper::prepareStatuses($this->items);
     $this->commentsEnabled = $this->params->get("comments_enabled", 1);
     // Prepare integration. Load avatars and profiles.
     $this->prepareIntegration($this->params);
     $this->prepareDocument();
     parent::display($tpl);
 }
Пример #9
0
                        <?php 
        echo $this->escape($comment->comment);
        ?>
                    </div>

                    <div class="clearfix"></div>
                    <div class="well well-sm clearfix">
                        <div class="pull-left">
                            <?php 
        $profile = JHtml::_('userideas.profile', $this->socialProfiles, $comment->user_id);
        echo JHtml::_('userideas.publishedByOn', $comment->author, $comment->record_date, $profile);
        ?>
                        </div>
                        <div class="pull-right">
                            <?php 
        if (UserIdeasHelper::isValidOwner($this->userId, $comment->user_id) and $this->canEditComment) {
            ?>
                                <a class="btn btn-default btn-sm" href="<?php 
            echo JRoute::_(UserIdeasHelperRoute::getDetailsRoute($this->item->slug, $this->item->catid) . '&comment_id=' . (int) $comment->id);
            ?>
#ui-comment-form">
                                    <span class="fa fa-edit"></span>
                                    <?php 
            echo JText::_('COM_USERIDEAS_EDIT');
            ?>
                                </a>
                            <?php 
        }
        ?>
                        </div>
                    </div>
Пример #10
0
        ?>
" >
            		<i class="icon-comment"></i>
            		<?php 
        echo JText::_("COM_USERIDEAS_COMMENTS");
        ?>
            		<?php 
        echo "( " . $commentsNumber . " )";
        ?>
            	</a> 
            	<?php 
    }
    ?>

            	<?php 
    if (UserIdeasHelper::isValidOwner($this->userId, $item->user_id) and $this->canEdit) {
        ?>
            	<a class="btn btn-small" href="<?php 
        echo JRoute::_(UserIdeasHelperRoute::getFormRoute($item->id));
        ?>
" >
            		<i class="icon-edit"></i>
            		<?php 
        echo JText::_("COM_USERIDEAS_EDIT");
        ?>
            	</a>
            	<?php 
    }
    ?>
            </div>
        </div>
Пример #11
0
    }
    ?>

                <?php 
    if ($this->params->get('show_intro', $item->params->get('show_intro', 1))) {
        ?>
                    <?php 
        echo JHtmlString::truncate($item->description, $this->params->get("items_description_length", 255), true, $this->params->get('items_description_html', 0));
        ?>
                <?php 
    }
    ?>
            </div>
            <?php 
    $this->canEditResult = UserIdeasHelper::isValidOwner($this->userId, $item->user_id) and $this->canEdit;
    if (UserIdeasHelper::shouldDisplayFootbar($item->params, $item->params, false) or $this->canEditResult or $this->commentsEnabled) {
        echo '<div class="clearfix"></div>';
        $layoutData = new stdClass();
        $layoutData->item = $item;
        $layoutData->socialProfiles = $this->socialProfiles;
        $layoutData->integrationOptions = $this->integrationOptions;
        $layoutData->commentsEnabled = $this->commentsEnabled;
        $layoutData->canEditResult = $this->canEditResult;
        $layoutData->params = $this->params;
        $layoutData->commentsNumber = $commentsNumber;
        $layout = new JLayoutFile('footbar');
        echo $layout->render($layoutData);
    }
    ?>
        </div>
    <?php 
Пример #12
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     UserIdeasHelper::addSubmenu($this->getName());
     $this->sidebar = JHtmlSidebar::render();
 }