[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/administrator/components/com_poll/ -> toolbar.poll.html.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Polls
   5  * @author Mambo Foundation Inc see README.php
   6  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   7  * See COPYRIGHT.php for copyright notices and details.
   8  * @license GNU/GPL Version 2, see LICENSE.php
   9  *
  10  * Redistributions of files must retain the above copyright notice.
  11  *
  12  * Mambo is free software; you can redistribute it and/or
  13  * modify it under the terms of the GNU General Public License
  14  * as published by the Free Software Foundation; version 2 of the License.
  15  */
  16  
  17  /** ensure this file is being included by a parent file */
  18  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  19  
  20  class TOOLBAR_poll {
  21      /**
  22      * Draws the menu for a New category
  23      */
  24  	function _NEW() {
  25          mosMenuBar::startTable();
  26          mosMenuBar::save();
  27          mosMenuBar::spacer();
  28          mosMenuBar::cancel();
  29          mosMenuBar::spacer();
  30          mosMenuBar::help( 'new' );
  31          mosMenuBar::endTable();
  32      }
  33      /**
  34      * Draws the menu for Editing an existing category
  35      */
  36  	function _EDIT( $pollid, $cur_template ) {
  37          global $database;
  38          global $id;
  39          
  40          // @RawSQLUse, trivial_implementation, SELECT
  41          $sql = "SELECT template FROM #__templates_menu WHERE client_id='0' AND menuid='0'";
  42          $database->setQuery( $sql );
  43          $cur_template = $database->loadResult();
  44          mosMenuBar::startTable();
  45          $popup='pollwindow';
  46          ?>
  47          <td><a class="toolbar" href="#" onclick="window.open('popups/<?php echo $popup;?>.php?pollid=<?php echo $pollid; ?>&t=<?php echo $cur_template; ?>', 'win1', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');" onmouseout="MM_swapImgRestore();"  onmouseover="MM_swapImage('preview','','images/preview_f2.png',1);"><img src="images/preview.png" alt="<?php echo T_('Preview') ?>" border="0" name="preview" align="middle" /><br /><?php echo T_('Preview') ?></a></td>
  48          <?php
  49          mosMenuBar::spacer();
  50          mosMenuBar::save();
  51          mosMenuBar::spacer();
  52          if ( $id ) {
  53              // for existing content items the button is renamed `close`
  54              mosMenuBar::cancel( 'cancel', T_('Close') );
  55          } else {
  56              mosMenuBar::cancel();
  57          }
  58          mosMenuBar::spacer();
  59          mosMenuBar::help( 'edit' );
  60          mosMenuBar::endTable();
  61      }
  62  	function _DEFAULT() {
  63          mosMenuBar::startTable();
  64          mosMenuBar::publishList();
  65          mosMenuBar::spacer();
  66          mosMenuBar::unpublishList();
  67          mosMenuBar::spacer();
  68          mosMenuBar::addNewX();
  69          mosMenuBar::spacer();
  70          mosMenuBar::editListX();
  71          mosMenuBar::spacer();
  72          mosMenuBar::deleteList();
  73          mosMenuBar::spacer();
  74          mosMenuBar::help( 'manager' );
  75          mosMenuBar::endTable();
  76      }
  77  }
  78  ?>