Your IP : 216.73.217.53


Current Path : /home/bonneesp/www/administrator/components/com_gallery_wd/views/comments/tmpl/
Upload File :
Current File : /home/bonneesp/www/administrator/components/com_gallery_wd/views/comments/tmpl/default.php

<?php
 /**
 * @package Gallery WD
 * @author Web-Dorado
 * @copyright (C) 2014 Web-Dorado. All rights reserved.
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 **/
 
defined('_JEXEC') or die('Restricted Access');

// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', 'select');
require_once(WD_BWG_DIR . '/framework/WDWLibrary.php');

 $rows_data = $this->get_rows_data;

    $option_row = $this->get_option_row_data;
	$lists=$this->lists;
	$pageNav=$this->pageNav;
    
	$search_value = ((isset($_POST['search_value'])) ? htmlspecialchars($_POST['search_value']) : '');
    $search_select_value = ((isset($_POST['search_select_value'])) ? (int) $_POST['search_select_value'] : 0);
    $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? htmlspecialchars($_POST['asc_or_desc']) : 'asc');
    $order_by = (isset($_POST['order_by']) ? htmlspecialchars($_POST['order_by']) : 'name');
    $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
    $ids_string = '';
    ?>
	<style>
	.actions
	{
	overflow: visible;
	}
	</style>
    <div style="font-size: 14px; font-weight: bold;">
      This section allows you to manage the image comments.
      <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/joomla-gallery-guide-step-7.html">Read More in User Manual</a>
    </div>
    <form class="wrap" id="adminForm" name="adminForm" method="post" action="index.php?option=com_gallery_wd&view=comments" style="width:95%;">
      <span class="comment_icon"></span>
      <h2>
        Comments
      </h2>

      <div class="tablenav top">
        <?php
        WDWLibrary::search_select('Image',$search_select_value, $this->get_images_for_comments_table, 'adminForm');
        //WDWLibrary::search('Name', $lists['search'], 'adminForm');
       // WDWLibrary::html_page_nav($page_nav['total'], $page_nav['limit'], 'adminForm');
        ?>
      </div>
	  
	  	  			<table width="100%">
					<tr>
					<td>
					<?php
       // WDWLibrary::search_select('Image',$search_select_value, $this->get_images_for_comments_table, 'adminForm'); ?>
					</td>
					</td>
		<tr>
			<td align="left" width="100%">
				<input type="text" name="search" id="search" value="<?php echo $lists['search'];?>" class="text_area"  placeholder="Search" style="margin:0px" />
				<button class="btn tip hasTooltip" type="submit" data-original-title="Search"><i class="icon-search"></i></button>
				<button class="btn tip hasTooltip" type="button" onclick="document.id('search').value='';this.form.submit();" data-original-title="Clear">
				<i class="icon-remove"></i></button>
				
				<div class="btn-group pull-right hidden-phone">
					<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
					<?php echo $pageNav->getLimitBox(); ?>
				</div>

			</td>
		</tr>
		</table>  
      <table class="table table-striped">
        <thead>

		  <th width="20"><input type="checkbox" name="toggle" value="" onclick="Joomla.checkAll(this)"></th>

				<th width="30" class="title"><?php echo JHTML::_('grid.sort',   'ID', 'id', @$lists['order_Dir'], @$lists['order'] ); ?></th>
				
				<th nowrap="nowrap" width="100"><?php echo JHTML::_('grid.sort', 'Image', 'image_id', @$lists['order_Dir'], @$lists['order'] ); ?></th>
	
                
				<th nowrap="nowrap" width="100"><?php echo JHTML::_('grid.sort',   'Name', 'name',@$lists['order_Dir'], @$lists['order'] ); ?></th>

				
				<th nowrap="nowrap" width="100"><?php echo JHTML::_('grid.sort',   'Comment', 'comment',@$lists['order_Dir'], @$lists['order'] ); ?></th>
				
				         <?php
          if ($option_row->popup_enable_email) {
          ?>
				<th id="th_order" nowrap="nowrap" width="100"><?php echo JHTML::_('grid.sort',   'Email', 'email',@$lists['order_Dir'], @$lists['order'] ); ?></th>
		<?php } ?>
				
				
				<th nowrap="nowrap" width="100"><?php echo JHTML::_('grid.sort',   'Published', 'published',@$lists['order_Dir'], @$lists['order'] ); ?></th>
		  
		  
          <th class="table_big_col">Delete</th>
        </thead>
        <tbody id="tbody_arr">
          <?php
          if ($rows_data) {
		  $i=0;
            foreach ($rows_data as $row_data) {
              $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
              $row_data->preview_image = get_image_for_comments_table($row_data->image_id);
              $row_data->preview_image_filename = get_image_filename_for_comments_table($row_data->image_id);
              $published_image = (($row_data->published) ? 'publish' : 'unpublish');
              $published = (($row_data->published) ? 'unpublish' : 'publish');
			  
			    $checked 	= JHTML::_('grid.id', $i, $row_data->id);
				$published 	= published($row_data, $i, 'calendar');
			  
              ?>
              <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
                <td><?php echo $checked?></td>
                <td><?php echo $row_data->id; ?></td>
                <td>
                  <?php 
                  if ($row_data->preview_image) {
                  ?>
                  <img title="<?php echo $row_data->preview_image_filename; ?>" style="border: 1px solid #CCCCCC; max-width:60px; max-height:60px;" src="<?php echo JURI::root()  . WD_BWG_UPLOAD_DIR. '/' . $row_data->preview_image . '?date=' . date('Y-m-y H:i:s'); ?>">
                  <?php
                  }
                  ?>
                </td>
                <td><?php echo $row_data->name; ?></td>
                <td style="cursor:context-menu" ><?php echo $row_data->comment; ?></td>
                <?php
                if ($option_row->popup_enable_email) {
                ?>
                <td><?php echo $row_data->mail; ?></td>
                <?php
                }
                ?>
				<td align="center"><?php echo $published?></td>
                <td class="table_big_col"><a onclick="spider_set_input_value('task', 'comments.delete');
                                                      spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
													  jQuery('#cb<?php echo $i ?>').attr('checked','cheched');
                                                      spider_form_submit(event, 'adminForm')" href="">Delete</a></td>
              </tr>
              <?php
              $ids_string .= $row_data->id . ',';
			  $i++;
            }
          }
          ?>
        </tbody>
				<tfoot>
			<tr>
				<td colspan="11">
				 <?php echo $pageNav->getListFooter(); ?>
				</td>
			</tr>
		</tfoot>
      </table>
      <input id="task" name="task" type="hidden" value="" />
      <input id="current_id" name="current_id" type="hidden" value="" />
      <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
      <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
      <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
	  <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
	  		<input type="hidden" name="boxchecked" value="0"> 

	<input type="hidden" id="filter_order_Dir" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" /> 

    		 		<?php echo JHtml::_( 'form.token' ); ?>	

	
    </form>
    <?php
	
 function get_image_for_comments_table($image_id) {
    $db =JFactory::getDBO();
	$query="SELECT thumb_url FROM #__bwg_image WHERE id=".$db->escape($image_id);
	$db->setQuery($query);
    $preview_image = $db->loadResult();
    return $preview_image;
  }

 function get_image_filename_for_comments_table($image_id) {
    $db =JFactory::getDBO();
	$query="SELECT filename FROM #__bwg_image WHERE id=".$db->escape($image_id);	
	$db->setQuery($query);
    $preview_image_filename = $db->loadResult();
    return $preview_image_filename;
  }
	
	function published( &$row, $i, $task, $imgY = 'tick.png', $imgX = 'publish_x.png', $prefix='' ){
        $img     = $row->published ? $imgY : $imgX;
        $task     = $row->published ? 'comments.unpublish' : 'comments.publish';
        $alt     = $row->published ? JText::_( 'Published' ) : JText::_( 'Unpublished' );
        $action = $row->published ? JText::_( 'Unpublish Item' ) : JText::_( 'Publish item' );
 
        $href = '
        <a href="javascript:void(0);" onclick="return listItemTask(\'cb'. $i .'\',\''. $prefix.$task .'\')" title="'. $action .'">
        <img src="templates/hathor/images/admin/'. $img .'" border="0" alt="'. $alt .'" /></a>'
        ;
 
        return $href;
    
}