name : default.php
<?php
/**
 
 * @package     pkg_dearflip
 * @subpackage  com_dearflip
 * @since       1.0.0
 * @copyright   Copyright © 2007 Free Software Foundation, Inc. All rights reserved.
 * @license   GNU General Public License version 3 or later; see https://www.gnu.org/licenses/gpl-3.0.en.html
 
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Session\Session;


JHtml::_('formbehavior.chosen', 'select');


$document = JFactory::getDocument();

$listOrder     = $this->escape($this->state->get('list.ordering'));
$listDirn      = $this->escape($this->state->get('list.direction'));


$user = JFactory::getUser();
$userId = $user->get('id');
$saveOrder = $listOrder == 'ordering';

if ($saveOrder)
{
    $saveOrderingUrl = 'index.php?option=com_dearflip&task=dearflips.saveOrderAjax&tmpl=component';
    JHtml::_('sortablelist.sortable', 'dearflipList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}

?>

<script>
  jQuery(document).ready(function () {
    var comClass  = jQuery(".com_dearflip")
    var addnewbtn= comClass.children().find('.button-new');
    addnewbtn.addClass("df_addbtn_class");
    var editbtn= comClass.children().find('.button-edit');
    editbtn.addClass("df_toolbarbtn_class");
    var deletebtn= comClass.children().find('.button-delete');
    deletebtn.addClass("df_toolbarbtn_class");
    deletebtn.find('.icon-delete').addClass('df_icon_border')
    editbtn.find('.icon-edit').addClass('df_icon_border');
    var comHeader=comClass.children().find('.header');
    comHeader.addClass("df_header_class")
  
    
    });
</script>

<style>
  .df_addbtn_class{
  background: #3071a9 !important;
  border-color: white !important;;
      color: #FFFFFF !important;
      opacity: 1;
  }
  .df_header_class{
      background-color: #3071a9 !important;
      
  }
  .df_toolbarbtn_class{
      border-color: #3071a9 !important;
  }
  .df_icon_border{
      border-color: #3071a9 !important;
      
  }
  .df_code_block{
      padding: 3px 5px 2px 5px;
      margin: 0 1px;
      width: fit-content;
      background: #eaeaea;j
      background: rgba(0,0,0,.07);
      font-size: 13px;
      font-family: Consolas,Monaco,monospace
  }
  
</style>




<form action="index.php?option=com_dearflip&view=dearflips" method="post" id="adminForm" name="adminForm">

  <div class="row-fluid">
    <div class="span6">
      <?php echo JText::_('COM_DEARFLIP_DEARFLIPS_FILTER'); ?>
      <?php
      echo JLayoutHelper::render(
          'joomla.searchtools.default',
          array( 'view' => $this )
      );
      ?>
    </div>
  </div>

  <table class="table table-striped table-hover" id="dearflipList">

    <thead>
    <tr>
      <th width="1%"><?php echo JText::_('COM_DEARFLIP_NUM'); ?></th>
      <th width="1%">
          <?php echo JHTML::_('searchtools.sort', '','ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
      </th>

      <th width="2%">
          <?php echo JHTML::_('grid.checkall'); ?>
      </th>


      <th width="50%">
        <?php echo JHTML::_('searchtools.sort', 'COM_DEARFLIP_DEARFLIPS_NAME', 'book_title', $listDirn, $listOrder); ?>
      </th>
      <th width="30%">
        <?php echo JText::_('COM_DEARFLIP_SHORTCODE'); ?>
      </th>
      <th width="5%">
        <?php echo JHTML::_('searchtools.sort', 'COM_DEARFLIP_PUBLISHED', 'published',  $listDirn, $listOrder); ?>
      </th>
      <th width="2%">
        <?php echo JHTML::_('searchtools.sort', 'COM_DEARFLIP_ID', 'id' ,  $listDirn, $listOrder); ?>
      </th>
    </tr>
    </thead>
    <tfoot>
    <tr>
      <td colspan="6">
       
          <?php echo $this->pagination->getListFooter(); ?>
      </td>
    </tr>
    </tfoot>
    <tbody >

    <?php
    
    
    if (!empty($this->items)) : ?>
      <?php foreach ($this->items as $i => $row) :
        $link = JRoute::_('index.php?option=com_dearflip&task=dearflip.edit&id=' . $row->id);
        ?>
        <tr class="row<?php echo $i % 2; ?>" sortable-group-id="<?php echo $row->df_cat; ?>">
          <td>
              <?php echo $this->pagination->getRowOffset($i); ?>
          </td>

          <td><?php
              $iconClass = '';
              $canReorder  = $user->authorise('core.edit.state', 'com_dearflip.dearflip.' . $row->id);
              if (!$canReorder)
              {
                  $iconClass = ' inactive';
                  echo "cannot reorder";
              }
              elseif (!$saveOrder)
              {
                  $iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::_('tooltipText', 'JORDERINGDISABLED');
              }
              ?>
              <span class="sortable-handler<?php echo $iconClass ?>">
                <span class="icon-menu" aria-hidden="true"></span>
              </span>
                <?php if ($canReorder && $saveOrder) :
                   // echo $row->ordering;
                    ?>
                  <input type="text" style="display:none" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="width-20 text-area-order" />
                <?php endif; ?>
            </td>


          <td>
              <?php echo JHtml::_('grid.id', $i, $row->id); ?>
          </td>
          <td>
            <a href="<?php echo $link; ?>" title="<?php echo JText::_('COM_DEARFLIP_EDIT_DEARFLIP'); ?>">
              <?php
              if($row->book_title==''){
                echo '[no title]';
              }
              else{echo $row->book_title;}
               ?>
          </td>
          
          <td>
            <div class="df_code_block">
            <?php echo "{dearflip id=" . $row->id . "}"; ?>  </div>
          </td>
          
          <td align="center">
            <?php echo JHtml::_('jgrid.published', $row->published, $i, 'dearflips.', true, 'cb'); ?>
          </td>
          <td align="center">
            <?php echo $row->id; ?>
          </td>
        </tr>
      <?php endforeach; ?>
    <?php endif; ?>
    </tbody>
  </table>

  <input type="hidden" name="task" value=""/>
  <input type="hidden" name="boxchecked" value="0"/>
    <?php echo JHtml::_('form.token'); ?>
</form>

© 2025 Cubjrnet7