public function addToolbar() { JToolBarHelper::title(JText::_(COM_SITEMAP), 'generic.png'); $result = SitemapHelper::getActions(); if ($result->get('core.create')) { JToolBarHelper::addNew('sitemap.add'); } if ($result->get('core.edit')) { JToolBarHelper::editList('sitemap.edit'); } JToolBarHelper::divider(); if ($result->get('core.edit.state')) { JToolBarHelper::publishList('sitemaps.publish'); JToolBarHelper::unpublishList('sitemaps.unpublish'); } if ($result->get('core.delete')) { JToolBarHelper::deleteList(JText::_(COM_SITEMAP_DELETE_CONFIRM), 'sitemaps.delete'); } }
<div class="col-sm-2"> <?php echo $form->dropDownListGroup($sitemapPage, 'changefreq', ['widgetOptions' => ['data' => SitemapHelper::getChangeFreqList()]]); ?> </div> <div class="col-sm-2"> <?php echo $form->textFieldGroup($sitemapPage, 'priority'); ?> </div> <div class="col-sm-2"> <?php echo $form->dropDownListGroup($sitemapPage, 'status', ['widgetOptions' => ['data' => $sitemapPage->getStatusList()]]); ?> </div> </div> <div class="row"> <div class="col-sm-2"> <?php $this->widget('bootstrap.widgets.TbButton', ['buttonType' => 'submit', 'context' => 'primary', 'label' => Yii::t('SitemapModule.sitemap', 'Add')]); ?> </div> </div> <?php $this->endWidget(); ?> </div> <?php $this->widget('yupe\\widgets\\CustomGridView', ['id' => 'page-grid', 'dataProvider' => $sitemapPage->search(), 'filter' => $sitemapPage, 'sortField' => 'order', 'template' => "{multiaction}\n{items}\n{pager}", 'actionsButtons' => false, 'columns' => [['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'url', 'editable' => ['url' => $this->createUrl('/sitemap/sitemapBackend/inlinePage'), 'mode' => 'inline', 'params' => [Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeTextField($sitemapPage, 'url', ['class' => 'form-control'])], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'changefreq', 'editable' => ['url' => $this->createUrl('/sitemap/sitemapBackend/inlinePage'), 'mode' => 'inline', 'type' => 'select', 'source' => SitemapHelper::getChangeFreqList(), 'params' => [Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeDropDownList($sitemapPage, 'changefreq', SitemapHelper::getChangeFreqList(), ['class' => 'form-control', 'empty' => '']), 'htmlOptions' => ['style' => 'width: 250px;']], ['class' => 'bootstrap.widgets.TbEditableColumn', 'name' => 'priority', 'editable' => ['url' => $this->createUrl('/sitemap/sitemapBackend/inlinePage'), 'mode' => 'inline', 'params' => [Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken]], 'filter' => CHtml::activeTextField($sitemapPage, 'priority', ['class' => 'form-control']), 'htmlOptions' => ['style' => 'width: 250px;']], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status', 'url' => $this->createUrl('/sitemap/sitemapBackend/inlinePage'), 'source' => $sitemapPage->getStatusList(), 'options' => [SitemapPage::STATUS_ACTIVE => ['class' => 'label-success'], SitemapPage::STATUS_NOT_ACTIVE => ['class' => 'label-default']], 'htmlOptions' => ['style' => 'width: 150px;']]]]);
private function getUrlRow($loc, $changefreq = SitemapHelper::FREQUENCY_DAILY, $priority = 0.5, $lastmod = null) { $res = CHtml::openTag('url'); $res .= CHtml::tag('loc', [], htmlspecialchars($loc)); $res .= CHtml::tag('changefreq', [], $changefreq); $res .= CHtml::tag('priority', [], $priority); if ($lastmod) { $res .= CHtml::tag('lastmod', [], SitemapHelper::dateToW3C($lastmod)); } $res .= CHtml::closeTag('url'); return $res; }
<?php echo JHtml::_('grid.sort', JText::_(COM_SITEMAP_LABEL_ALIAS), 'alias', $this->sortDirection, $this->sortColumn); ?> </th> <th width="2%"> <?php echo JHtml::_('grid.sort', JText::_(COM_SITEMAP_LABEL_STATUS), 'published', $this->sortDirection, $this->sortColumn); ?> </th> </tr> </thead> <tbody> <?php $actions = SitemapHelper::getActions(); ?> <?php foreach ($this->items as $key => $item) { ?> <tr class="row<?php echo $key % 2; ?> "> <td> <?php echo JHtml::_('grid.checkedOut', $item, $key); ?> </td> <td> <?php