PageRenderTime 46ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/administrator/components/com_content/views/articles/tmpl/modal.php

https://bitbucket.org/pastor399/newcastleunifc
PHP | 170 lines | 153 code | 10 blank | 7 comment | 12 complexity | ab67678be0be9305d0dec3191a56c9b6 MD5 | raw file
  1. <?php
  2. /**
  3. * @package Joomla.Administrator
  4. * @subpackage com_content
  5. *
  6. * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. defined('_JEXEC') or die;
  10. $app = JFactory::getApplication();
  11. if ($app->isSite())
  12. {
  13. JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN'));
  14. }
  15. require_once JPATH_ROOT . '/components/com_content/helpers/route.php';
  16. JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
  17. JHtml::_('bootstrap.tooltip');
  18. $function = $app->input->getCmd('function', 'jSelectArticle');
  19. $listOrder = $this->escape($this->state->get('list.ordering'));
  20. $listDirn = $this->escape($this->state->get('list.direction'));
  21. ?>
  22. <form action="<?php echo JRoute::_('index.php?option=com_content&view=articles&layout=modal&tmpl=component&function='.$function.'&'.JSession::getFormToken().'=1');?>" method="post" name="adminForm" id="adminForm" class="form-inline">
  23. <fieldset class="filter clearfix">
  24. <div class="btn-toolbar">
  25. <div class="btn-group pull-left">
  26. <label for="filter_search">
  27. <?php echo JText::_('JSEARCH_FILTER_LABEL'); ?>
  28. </label>
  29. </div>
  30. <div class="btn-group pull-left">
  31. <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" size="30" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" />
  32. </div>
  33. <div class="btn-group pull-left">
  34. <button type="submit" class="btn hasTooltip" data-placement="bottom" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>">
  35. <span class="icon-search"></span><?php echo '&#160;' . JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
  36. <button type="button" class="btn hasTooltip" data-placement="bottom" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();">
  37. <span class="icon-remove"></span><?php echo '&#160;' . JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
  38. </div>
  39. <?php if ($app->isAdmin()) : ?>
  40. <input onclick="if (window.parent) window.parent.<?php echo $this->escape($function);?>('0', '<?php echo $this->escape(addslashes(JText::_('COM_CONTENT_SELECT_AN_ARTICLE'))); ?>', null, null);" class="btn" type="button" value="<?php echo JText::_('COM_CONTENT_NONE'); ?>" />
  41. <?php endif; ?>
  42. <div class="clearfix"></div>
  43. </div>
  44. <hr class="hr-condensed" />
  45. <div class="filters pull-left">
  46. <select name="filter_access" class="input-medium" onchange="this.form.submit()">
  47. <option value=""><?php echo JText::_('JOPTION_SELECT_ACCESS');?></option>
  48. <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?>
  49. </select>
  50. <select name="filter_published" class="input-medium" onchange="this.form.submit()">
  51. <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
  52. <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?>
  53. </select>
  54. <?php if ($this->state->get('filter.forcedLanguage')) : ?>
  55. <select name="filter_category_id" class="input-medium" onchange="this.form.submit()">
  56. <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY');?></option>
  57. <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_content', array('filter.language' => array('*', $this->state->get('filter.forcedLanguage')))), 'value', 'text', $this->state->get('filter.category_id'));?>
  58. </select>
  59. <input type="hidden" name="forcedLanguage" value="<?php echo $this->escape($this->state->get('filter.forcedLanguage')); ?>" />
  60. <input type="hidden" name="filter_language" value="<?php echo $this->escape($this->state->get('filter.language')); ?>" />
  61. <?php else : ?>
  62. <select name="filter_category_id" class="input-medium" onchange="this.form.submit()">
  63. <option value=""><?php echo JText::_('JOPTION_SELECT_CATEGORY');?></option>
  64. <?php echo JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $this->state->get('filter.category_id'));?>
  65. </select>
  66. <select name="filter_language" class="input-medium" onchange="this.form.submit()">
  67. <option value=""><?php echo JText::_('JOPTION_SELECT_LANGUAGE');?></option>
  68. <?php echo JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'));?>
  69. </select>
  70. <?php endif; ?>
  71. </div>
  72. </fieldset>
  73. <table class="table table-striped table-condensed">
  74. <thead>
  75. <tr>
  76. <th class="title">
  77. <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
  78. </th>
  79. <th width="15%" class="center nowrap">
  80. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?>
  81. </th>
  82. <th width="15%" class="center nowrap">
  83. <?php echo JHtml::_('grid.sort', 'JCATEGORY', 'a.catid', $listDirn, $listOrder); ?>
  84. </th>
  85. <th width="5%" class="center nowrap">
  86. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?>
  87. </th>
  88. <th width="5%" class="center nowrap">
  89. <?php echo JHtml::_('grid.sort', 'JDATE', 'a.created', $listDirn, $listOrder); ?>
  90. </th>
  91. <th width="1%" class="center nowrap">
  92. <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
  93. </th>
  94. </tr>
  95. </thead>
  96. <tfoot>
  97. <tr>
  98. <td colspan="15">
  99. <?php echo $this->pagination->getListFooter(); ?>
  100. </td>
  101. </tr>
  102. </tfoot>
  103. <tbody>
  104. <?php foreach ($this->items as $i => $item) : ?>
  105. <?php if ($item->language && JLanguageMultilang::isEnabled())
  106. {
  107. $tag = strlen($item->language);
  108. if ($tag == 5)
  109. {
  110. $lang = substr($item->language, 0, 2);
  111. }
  112. elseif ($tag == 6)
  113. {
  114. $lang = substr($item->language, 0, 3);
  115. }
  116. else {
  117. $lang = "";
  118. }
  119. }
  120. elseif (!JLanguageMultilang::isEnabled())
  121. {
  122. $lang = "";
  123. }
  124. ?>
  125. <tr class="row<?php echo $i % 2; ?>">
  126. <td>
  127. <a class="pointer" onclick="if (window.parent) window.parent.<?php echo $this->escape($function);?>('<?php echo $item->id; ?>', '<?php echo $this->escape(addslashes($item->title)); ?>', '<?php echo $this->escape($item->catid); ?>', null, '<?php echo $this->escape(ContentHelperRoute::getArticleRoute($item->id, $item->catid, $item->language)); ?>', '<?php echo $this->escape($lang); ?>', null);">
  128. <?php echo $this->escape($item->title); ?></a>
  129. </td>
  130. <td class="center">
  131. <?php echo $this->escape($item->access_level); ?>
  132. </td>
  133. <td class="center">
  134. <?php echo $this->escape($item->category_title); ?>
  135. </td>
  136. <td class="center">
  137. <?php if ($item->language == '*'):?>
  138. <?php echo JText::alt('JALL', 'language'); ?>
  139. <?php else:?>
  140. <?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
  141. <?php endif;?>
  142. </td>
  143. <td class="center nowrap">
  144. <?php echo JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')); ?>
  145. </td>
  146. <td class="center">
  147. <?php echo (int) $item->id; ?>
  148. </td>
  149. </tr>
  150. <?php endforeach; ?>
  151. </tbody>
  152. </table>
  153. <div>
  154. <input type="hidden" name="task" value="" />
  155. <input type="hidden" name="boxchecked" value="0" />
  156. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  157. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  158. <?php echo JHtml::_('form.token'); ?>
  159. </div>
  160. </form>