[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_contact/ -> admin.contact.html.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: admin.contact.html.php 18162 2010-07-16 07:00:47Z ian $
   4  * @package        Joomla
   5  * @subpackage    Contact
   6  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7  * @license        GNU/GPL, see LICENSE.php
   8  * Joomla! is free software. This version may have been modified pursuant
   9  * to the GNU General Public License, and as distributed it includes or
  10  * is derivative of works licensed under the GNU General Public License or
  11  * other free or open source software licenses.
  12  * See COPYRIGHT.php for copyright notices and details.
  13  */
  14  
  15  // no direct access
  16  defined( '_JEXEC' ) or die( 'Restricted access' );
  17  
  18  /**
  19  * @package        Joomla
  20  * @subpackage    Contact
  21  */
  22  class HTML_contact
  23  {
  24  	function showContacts( &$rows, &$pageNav, $option, &$lists )
  25      {
  26          $user =& JFactory::getUser();
  27  
  28          //Ordering allowed ?
  29          $ordering = ($lists['order'] == 'cd.ordering');
  30  
  31          JHTML::_('behavior.tooltip');
  32          ?>
  33          <form action="index.php?option=com_contact" method="post" name="adminForm">
  34  
  35          <table>
  36          <tr>
  37              <td align="left" width="100%">
  38                  <?php echo JText::_( 'Filter' ); ?>:
  39                  <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" />
  40                  <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
  41                  <button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
  42              </td>
  43              <td nowrap="nowrap">
  44                  <?php
  45                  echo $lists['catid'];
  46                  echo $lists['state'];
  47                  ?>
  48              </td>
  49          </tr>
  50          </table>
  51  
  52              <table class="adminlist">
  53              <thead>
  54                  <tr>
  55                      <th width="10">
  56                          <?php echo JText::_( 'Num' ); ?>
  57                      </th>
  58                      <th width="10" class="title">
  59                          <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" />
  60                      </th>
  61                      <th class="title">
  62                          <?php echo JHTML::_('grid.sort',   'Name', 'cd.name', @$lists['order_Dir'], @$lists['order'] ); ?>
  63                      </th>
  64                      <th width="5%" class="title" nowrap="nowrap">
  65                          <?php echo JHTML::_('grid.sort',   'Published', 'cd.published', @$lists['order_Dir'], @$lists['order'] ); ?>
  66                      </th>
  67                      <th nowrap="nowrap" width="8%">
  68                          <?php echo JHTML::_('grid.sort',   'Order by', 'cd.ordering', @$lists['order_Dir'], @$lists['order'] ); ?>
  69                          <?php if ($ordering) echo JHTML::_('grid.order',  $rows ); ?>
  70                      </th>
  71                      <th width="8%" nowrap="nowrap">
  72                          <?php echo JHTML::_('grid.sort',   'Access', 'cd.access', @$lists['order_Dir'], @$lists['order'] ); ?>
  73                      </th>
  74                      <th width="10%" class="title">
  75                          <?php echo JHTML::_('grid.sort',   'Category', 'category', @$lists['order_Dir'], @$lists['order'] ); ?>
  76                      </th>
  77                      <th class="title" nowrap="nowrap" width="10%">
  78                          <?php echo JHTML::_('grid.sort',   'Linked to User', 'user', @$lists['order_Dir'], @$lists['order'] ); ?>
  79                      </th>
  80                      <th width="1%" nowrap="nowrap">
  81                          <?php echo JHTML::_('grid.sort',   'ID', 'cd.id', @$lists['order_Dir'], @$lists['order'] ); ?>
  82                      </th>
  83                  </tr>
  84              </thead>
  85              <tfoot>
  86                  <tr>
  87                      <td colspan="11">
  88                          <?php echo $pageNav->getListFooter(); ?>
  89                      </td>
  90                  </tr>
  91              </tfoot>
  92              <tbody>
  93              <?php
  94              $k = 0;
  95              for ($i=0, $n=count($rows); $i < $n; $i++) {
  96                  $row = $rows[$i];
  97  
  98                  $link         = JRoute::_( 'index.php?option=com_contact&task=edit&cid[]='. $row->id );
  99  
 100                  $checked     = JHTML::_('grid.checkedout',   $row, $i );
 101                  $access     = JHTML::_('grid.access',   $row, $i );
 102                  $published     = JHTML::_('grid.published', $row, $i );
 103  
 104                  $row->cat_link     = JRoute::_( 'index.php?option=com_categories&section=com_contact_details&task=edit&type=other&cid[]='. $row->catid );
 105                  $row->user_link    = JRoute::_( 'index.php?option=com_users&task=editA&cid[]='. $row->user_id );
 106                  ?>
 107                  <tr class="<?php echo "row$k"; ?>">
 108                      <td>
 109                          <?php echo $pageNav->getRowOffset( $i ); ?>
 110                      </td>
 111                      <td>
 112                          <?php echo $checked; ?>
 113                      </td>
 114                      <td>
 115                      <?php
 116                      if (JTable::isCheckedOut($user->get ('id'), $row->checked_out )) :
 117                          echo htmlspecialchars($row->name);
 118                      else :
 119                          ?>
 120                          <span class="editlinktip hasTip" title="<?php echo JText::_( 'Edit Contact' );?>::<?php echo htmlspecialchars($row->name); ?>">
 121                          <a href="<?php echo $link; ?>">
 122                              <?php echo htmlspecialchars($row->name); ?></a> </span>
 123                          <?php
 124                      endif;
 125                      ?>
 126                      </td>
 127                      <td align="center">
 128                          <?php echo $published;?>
 129                      </td>
 130                      <td class="order">
 131                          <span><?php echo $pageNav->orderUpIcon( $i, ( $row->catid == @$rows[$i-1]->catid ), 'orderup', 'Move Up', $ordering ); ?></span>
 132                          <span><?php echo $pageNav->orderDownIcon( $i, $n, ( $row->catid == @$rows[$i+1]->catid ), 'orderdown', 'Move Down', $ordering ); ?></span>
 133                          <?php $disabled = $ordering ?  '' : 'disabled="disabled"'; ?>
 134                          <input type="text" name="order[]" size="5" value="<?php echo $row->ordering;?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
 135                      </td>
 136                      <td align="center">
 137                          <?php echo $access;?>
 138                      </td>
 139                      <td>
 140                          <a href="<?php echo $row->cat_link; ?>" title="<?php echo JText::_( 'Edit Category' ); ?>">
 141                              <?php echo $row->category; ?></a>
 142                      </td>
 143                      <td>
 144                          <a href="<?php echo $row->user_link; ?>" title="<?php echo JText::_( 'Edit User' ); ?>">
 145                              <?php echo $row->user; ?></a>
 146                      </td>
 147                      <td align="center">
 148                          <?php echo $row->id; ?>
 149                      </td>
 150                  </tr>
 151                  <?php
 152                  $k = 1 - $k;
 153              }
 154              ?>
 155              </tbody>
 156              </table>
 157  
 158          <input type="hidden" name="option" value="<?php echo $option; ?>" />
 159          <input type="hidden" name="task" value="" />
 160          <input type="hidden" name="boxchecked" value="0" />
 161          <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
 162          <input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />
 163          <?php echo JHTML::_( 'form.token' ); ?>
 164          </form>
 165          <?php
 166      }
 167  
 168  	function editContact( &$row, &$lists, $option, &$params ) {
 169  
 170          JRequest::setVar( 'hidemainmenu', 1 );
 171  
 172          if ($row->image == '') {
 173              $row->image = 'blank.png';
 174          }
 175  
 176          JHTML::_('behavior.tooltip');
 177          jimport('joomla.html.pane');
 178          // TODO: allowAllClose should default true in J!1.6, so remove the array when it does.
 179          $pane = &JPane::getInstance('sliders', array('allowAllClose' => true));
 180  
 181          JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'misc' );
 182          $cparams = JComponentHelper::getParams ('com_media');
 183          ?>
 184          <script language="javascript" type="text/javascript">
 185          <!--
 186  		function submitbutton(pressbutton) {
 187              var form = document.adminForm;
 188              if (pressbutton == 'cancel') {
 189                  submitform( pressbutton );
 190                  return;
 191              }
 192  
 193              // do field validation
 194              if ( form.name.value == "" ) {
 195                  alert( "<?php echo JText::_( 'You must provide a name.', true ); ?>" );
 196              } else if ( form.catid.value == 0 ) {
 197                  alert( "<?php echo JText::_( 'Please select a Category.', true ); ?>" );
 198              } else {
 199                  submitform( pressbutton );
 200              }
 201          }
 202          //-->
 203          </script>
 204  
 205          <form action="index.php" method="post" name="adminForm">
 206  
 207          <div class="col width-60">
 208              <fieldset class="adminform">
 209                  <legend><?php echo JText::_( 'Details' ); ?></legend>
 210  
 211                  <table class="admintable">
 212                  <tr>
 213                      <td class="key">
 214                          <label for="name">
 215                              <?php echo JText::_( 'Name' ); ?>:
 216                          </label>
 217                      </td>
 218                      <td >
 219                          <input class="inputbox" type="text" name="name" id="name" size="60" maxlength="255" value="<?php echo $row->name; ?>" />
 220                      </td>
 221                  </tr>
 222                  <tr>
 223                      <td class="key">
 224                          <label for="name">
 225                              <?php echo JText::_( 'Alias' ); ?>:
 226                          </label>
 227                      </td>
 228                      <td >
 229                          <input class="inputbox" type="text" name="alias" id="alias" size="60" maxlength="255" value="<?php echo $row->alias; ?>" />
 230                      </td>
 231                  </tr>
 232                  <tr>
 233                      <td class="key">
 234                          <?php echo JText::_( 'Published' ); ?>:
 235                      </td>
 236                      <td>
 237                          <?php echo $lists['published']; ?>
 238                      </td>
 239                  </tr>
 240                  <tr>
 241                      <td class="key">
 242                          <label for="catid">
 243                              <?php echo JText::_( 'Category' ); ?>:
 244                          </label>
 245                      </td>
 246                      <td>
 247                          <?php echo $lists['catid'];?>
 248                      </td>
 249                  </tr>
 250                  <tr>
 251                      <td class="key">
 252                          <label for="user_id">
 253                              <?php echo JText::_( 'Linked to User' ); ?>:
 254                          </label>
 255                      </td>
 256                      <td >
 257                          <?php echo $lists['user_id'];?>
 258                      </td>
 259                  </tr>
 260                  <tr>
 261                      <td valign="top" class="key">
 262                          <label for="ordering">
 263                              <?php echo JText::_( 'Ordering' ); ?>:
 264                          </label>
 265                      </td>
 266                      <td>
 267                          <?php echo $lists['ordering']; ?>
 268                      </td>
 269                  </tr>
 270                  <tr>
 271                      <td valign="top" class="key">
 272                          <label for="access">
 273                              <?php echo JText::_( 'Access' ); ?>:
 274                          </label>
 275                      </td>
 276                      <td>
 277                          <?php echo $lists['access']; ?>
 278                      </td>
 279                  </tr>
 280                  <?php
 281                  if ($row->id) {
 282                      ?>
 283                      <tr>
 284                          <td class="key">
 285                              <label>
 286                                  <?php echo JText::_( 'ID' ); ?>:
 287                              </label>
 288                          </td>
 289                          <td>
 290                              <strong><?php echo $row->id;?></strong>
 291                          </td>
 292                      </tr>
 293                      <?php
 294                  }
 295                  ?>
 296                  </table>
 297              </fieldset>
 298  
 299              <fieldset class="adminform">
 300                  <legend><?php echo JText::_( 'Information' ); ?></legend>
 301  
 302                  <table class="admintable">
 303                  <tr>
 304                      <td class="key">
 305                      <label for="con_position">
 306                          <?php echo JText::_( 'Contact\'s Position' ); ?>:
 307                          </label>
 308                      </td>
 309                      <td>
 310                          <input class="inputbox" type="text" name="con_position" id="con_position" size="60" maxlength="255" value="<?php echo $row->con_position; ?>" />
 311                      </td>
 312                  </tr>
 313                  <tr>
 314                      <td class="key">
 315                          <label for="email_to">
 316                              <?php echo JText::_( 'E-mail' ); ?>:
 317                          </label>
 318                      </td>
 319                      <td>
 320                          <input class="inputbox" type="text" name="email_to" id="email_to" size="60" maxlength="255" value="<?php echo $row->email_to; ?>" />
 321                      </td>
 322                  </tr>
 323                  <tr>
 324                      <td class="key" valign="top">
 325                          <label for="address">
 326                              <?php echo JText::_( 'Street Address' ); ?>:
 327                              </label>
 328                          </td>
 329                          <td>
 330                               <textarea name="address" id="address" rows="3" cols="45" class="inputbox"><?php echo $row->address; ?></textarea>
 331                      </td>
 332                  </tr>
 333                  <tr>
 334                      <td class="key">
 335                          <label for="suburb">
 336                              <?php echo JText::_( 'Town/Suburb' ); ?>:
 337                          </label>
 338                      </td>
 339                      <td>
 340                          <input class="inputbox" type="text" name="suburb" id="suburb" size="60" maxlength="100" value="<?php echo $row->suburb;?>" />
 341                      </td>
 342                  </tr>
 343                  <tr>
 344                      <td class="key">
 345                          <label for="state">
 346                              <?php echo JText::_( 'State/County' ); ?>:
 347                          </label>
 348                      </td>
 349                      <td>
 350                          <input class="inputbox" type="text" name="state" id="state" size="60" maxlength="100" value="<?php echo $row->state;?>" />
 351                      </td>
 352                  </tr>
 353                  <tr>
 354                      <td class="key">
 355                          <label for="postcode">
 356                              <?php echo JText::_( 'Postal Code/ZIP' ); ?>:
 357                          </label>
 358                      </td>
 359                      <td>
 360                          <input class="inputbox" type="text" name="postcode" id="postcode" size="60" maxlength="100" value="<?php echo $row->postcode; ?>" />
 361                      </td>
 362                  </tr>
 363                  <tr>
 364                      <td class="key">
 365                          <label for="country">
 366                              <?php echo JText::_( 'Country' ); ?>:
 367                          </label>
 368                      </td>
 369                      <td>
 370                          <input class="inputbox" type="text" name="country" id="country" size="60" maxlength="100" value="<?php echo $row->country;?>" />
 371                      </td>
 372                  </tr>
 373                  <tr>
 374                      <td class="key" valign="top">
 375                      <label for="telephone">
 376                      <?php echo JText::_( 'Telephone' ); ?>:
 377                          </label>
 378                      </td>
 379                      <td>
 380                          <input class="inputbox" type="text" name="telephone" id="telephone" size="60" maxlength="255" value="<?php echo $row->telephone; ?>" />
 381                        </td>
 382                  </tr>
 383                  <tr>
 384                      <td class="key" valign="top">
 385                          <label for="mobile">
 386                              <?php echo JText::_( 'Mobile' ); ?>:
 387                          </label>
 388                      </td>
 389                      <td>
 390                           <input class="inputbox" type="text" name="mobile" id="mobile" size="60" maxlength="255" value="<?php echo $row->mobile; ?>" />
 391                      </td>
 392                  </tr>
 393                  <tr>
 394                      <td class="key" valign="top">
 395                          <label for="fax">
 396                              <?php echo JText::_( 'Fax' ); ?>:
 397                          </label>
 398                      </td>
 399                      <td>
 400                          <input class="inputbox" type="text" name="fax" id="fax" size="60" maxlength="255" value="<?php echo $row->fax; ?>" />
 401                       </td>
 402                  </tr>
 403                  <tr>
 404                      <td class="key">
 405                          <label for="webpage">
 406                              <?php echo JText::_( 'Webpage' ); ?>:
 407                          </label>
 408                      </td>
 409                      <td>
 410                          <input class="inputbox" type="text" name="webpage" id="webpage" size="60" maxlength="255" value="<?php echo $row->webpage; ?>" />
 411                      </td>
 412                  </tr>
 413                  <tr>
 414                      <td  class="key" valign="top">
 415                          <label for="misc">
 416                              <?php echo JText::_( 'Miscellaneous Info' ); ?>:
 417                          </label>
 418                      </td>
 419                      <td>
 420                          <textarea name="misc" id="misc" rows="5" cols="45" class="inputbox"><?php echo $row->misc; ?></textarea>
 421                      </td>
 422                  </tr>
 423                  <tr>
 424                      <td class="key">
 425                          <label for="image">
 426                              <?php echo JText::_( 'Image' ); ?>:
 427                          </label>
 428                      </td>
 429                      <td >
 430                          <?php echo $lists['image']; ?>
 431                      </td>
 432                  </tr>
 433                  <tr>
 434                      <td colspan="2">
 435                          <script language="javascript" type="text/javascript">
 436                          if (document.forms.adminForm.image.options.value!=''){
 437                              jsimg='../<?php echo $cparams->get('image_path'); ?>/' + getSelectedValue( 'adminForm', 'image' );
 438                          } else {
 439                              jsimg='../images/M_images/blank.png';
 440                          }
 441                          document.write('<img src=' + jsimg + ' name="imagelib" width="100" height="100" border="2" alt="<?php echo JText::_( 'Preview' ); ?>" />');
 442                          </script>
 443                      </td>
 444                  </tr>
 445                  </table>
 446              </fieldset>
 447          </div>
 448  
 449          <div class="col width-40">
 450              <fieldset class="adminform">
 451                  <legend><?php echo JText::_( 'Parameters' ); ?></legend>
 452  
 453                  <?php
 454                      echo $pane->startPane("menu-pane");
 455                      echo $pane->startPanel(JText :: _('Contact Parameters'), "param-page");
 456                      echo $params->render();
 457                      echo $pane->endPanel();
 458                      echo $pane->startPanel(JText :: _('Advanced Parameters'), "param-page");
 459                      echo $params->render('params', 'advanced');
 460                      echo $pane->endPanel();
 461                      echo $pane->startPanel(JText :: _('E-mail Parameters'), "param-page");
 462                      echo $params->render('params', 'email');
 463                      echo $pane->endPanel();
 464                      echo $pane->endPane();
 465                  ?></fieldset>
 466          </div>
 467          <div class="clr"></div>
 468  
 469          <input type="hidden" name="option" value="<?php echo $option; ?>" />
 470          <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
 471          <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
 472          <input type="hidden" name="task" value="" />
 473          <?php echo JHTML::_( 'form.token' ); ?>
 474          </form>
 475          <?php
 476      }
 477  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1