how to add print/email icon in my component through code - Joomla! Forum - community, help and support


i have created component of own , works fine in joomla 2.5 code not in line version mentioned. want add print/email icon component stuck because cannot follow code in com_content.

code: select all

<?php if ($canedit ||  $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
   <ul class="actions">
   <?php if (!$this->print) : ?>
      <?php if ($params->get('show_print_icon')) : ?>
         <li class="print-icon">
         <?php echo jhtml::_('icon.print_popup',  $this->item, $params); ?>
         </li>
      <?php endif; ?>

      <?php if ($params->get('show_email_icon')) : ?>
         <li class="email-icon">
         <?php echo jhtml::_('icon.email',  $this->item, $params); ?>
         </li>
      <?php endif; ?>

      <?php if ($canedit) : ?>
         <li class="edit-icon">
         <?php echo jhtml::_('icon.edit', $this->item, $params); ?>
         </li>
      <?php endif; ?>

   <?php else : ?>
      <li>
      <?php echo jhtml::_('icon.print_screen',  $this->item, $params); ?>
      </li>
   <?php endif; ?>

   </ul>
<?php endif; ?>

i can see done in way above don't understand $params, $state & $canedit are. code has nothing that. below view.php file.

code: select all

<?php
defined('_jexec') or die('restricted access');
jimport('joomla.application.component.view');

class circularsviewresult extends jview
{

   function display()
   {    
     $mainframe = jfactory::getapplication();
     global $option;

     $filter_order = $mainframe->getuserstatefromrequest($option.'filter_order', 'filter_order', 'a.title', 'cmd');
     $filter_order_dir = $mainframe->getuserstatefromrequest($option.'filter_order_dir', 'filter_order_dir', '', 'word');
    
     $doc =& jfactory::getdocument();
      $doc->addstylesheet('components/com_xxx/media/css/style.css');
   
     $search = $mainframe->getuserstatefromrequest($option.'search', 'search', '', 'string');
     $search = jstring::strtolower($search);
    
     $items = &$this->get('data');
     $total = &$this->get('total');
     $pagination = &$this->get('pagination');
    
     $lists['order_dir'] = $filter_order_dir;
     $lists['order'] = $filter_order;
     $lists['search'] = $search;
    
     $this->assignref('user', jfactory::getuser());
     $this->assignref('lists', $lists);
     $this->assignref('items', $items);
     $this->assignref('pagination', $pagination);
    
     parent::display();
   }
}
?>

and layout code below

code: select all

<?php
defined('_jexec') or die('restricted access');
?>
<form method="post" name="adminform" id="adminform">
   <table class="table">
      <thead>
         <tr>
              <td>
               <div align="left">
                <?php echo jtext::_( 'filter' ); ?>:
                   <input type="text" name="search" id="search" value="<?php echo $this->lists['search'];?>" class="inputbox1" onchange="document.adminform.submit();" />
                   &nbsp;<button onclick="this.form.submit();"><?php echo jtext::_( 'go' ); ?></button>
                   &nbsp;<button onclick="document.getelementbyid('search').value='';this.form.getelementbyid('filter_state').value='';this.form.submit();"><?php echo jtext::_( 'reset' ); ?></button>
                 </div>
            </td>
         </tr>
     </thead>
   </table>
<br>
   <table cellpadding="5" cellspacing="1" class="table">
      <thead>
         <tr>
          <th align="center"><?php echo jtext::_( 'num' ); ?></th>
         <th style="text-align:left; width: 80%;"><?php echo jtext::_( 'title' ); ?></th>
         <th><?php echo jtext::_( 'view circular' ); ?></th>
         </tr>             
      </thead>
      <!--<tfoot>
        <tr>
          <td colspan="6">
            <div align="center" class="pagination">
               <?php //echo $this->pagination->getpageslinks(); ?>
            </div>
         </td>
       </tr>
     </tfoot>
      <tbody>-->
         <?php
            $k = 0;
            ($i=0, $n=count( $this->items ); $i < $n; $i++)
            {
                $row = &$this->items[$i];
            $checked    = jhtml::_( 'grid.id', $i, $row->id );
            $item = jrequest::getvar( 'itemid' );
            $link = jroute::_( 'index.php?option=com_xxx&task=display');

            $ordering = ($this->lists['order'] == 'a.ordering');
         ?>
         <tr class="<?php echo "row$k";?>">
            <td align="center"><?php echo $this->pagination->getrowoffset( $i ); ?></td>
            <td style="text-align:left;">
            <?php echo $this->escape($row->title); ?>
         </td>
.
.
.
.

please give me tips!






Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support