Exemplo n.º 1
0
 /**
  * Public constructor
  *
  * @param   string Name of the combo
  * @param   string Data of the combo
  * @param   string Title of the combo
  * @param   string Widget ID
  * @access  public
  */
 function ComboImage($name, $title = '', $id = '')
 {
     $this->_name = $name;
     $this->_title = $title;
     $this->_id = $id;
     $this->_options = array();
     $this->setImageSize(16, 16);
     $this->_availableEvents = array('onchange', 'onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup');
     $oddClass = Piwi::getVarConf('CLASS_ODD');
     if (empty($oddClass)) {
         $oddClass = 'piwi_option_odd';
     }
     $this->setOddClass($oddClass);
     $evenClass = Piwi::getVarConf('CLASS_EVEN');
     if (empty($evenClass)) {
         $evenClass = 'piwi_option_even';
     }
     $this->setEvenClass($evenClass);
     parent::init();
 }
Exemplo n.º 2
0
 /**
  * Public constructor
  *
  * @param string Name of the combo
  * @param string Title of the combo
  * @param array  Data that will be used in the combo
  * @access  public
  */
 function Combo($name, $title = '', $options = array())
 {
     $this->_name = $name;
     $this->_title = $title;
     $this->_multiple = false;
     if (is_array($options) && !empty($options)) {
         $this->addOptions($options);
     } else {
         $this->_options = array();
     }
     $oddClass = Piwi::getVarConf('CLASS_ODD');
     if (empty($oddClass)) {
         $oddClass = 'piwi_option_odd';
     }
     $this->setOddClass($oddClass);
     $evenClass = Piwi::getVarConf('CLASS_EVEN');
     if (empty($evenClass)) {
         $evenClass = 'piwi_option_even';
     }
     $this->setEvenClass($evenClass);
     $this->_availableEvents = array("onchange", "onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover", "onmousemove", "onmouseout", "onkeypress", "onkeydown", "onkeyup");
     parent::init();
 }
Exemplo n.º 3
0
 /**
  * Initializes the main vars..
  *
  * @access    private
  */
 function init()
 {
     $this->_autoStyle = false;
     $this->_files = array();
     #$this->_PiwiXML   = new PiwiXMLBuilder();
     if (empty($this->_familyWidget)) {
         $this->_familyWidget = 'base';
     }
     if (empty($this->_id)) {
         $useNameAsId = Piwi::getVarConf('PIWI_NAME_AS_ID');
         if ($useNameAsId === true && !empty($this->_name)) {
             $this->setId($this->_name);
         }
     }
 }
Exemplo n.º 4
0
 /**
  * Sets the iframe src
  *
  * @access   public
  * @param    string src of the iframe
  */
 function setSrc($src)
 {
     $this->_src = substr($src, 0, 1) == '?' || substr($src, 0, 7) == 'http://' || substr($src, 0, 8) == 'https://' ? $src : Piwi::getVarConf('LINK_PRIFIX') . $src;
 }
Exemplo n.º 5
0
 /**
  * Public constructor
  *
  * @param   array   $data  Datagrid Data
  * @param   string  $caption Caption of the DataGrid
  * @param   string  $id    Id of the DataGrid
  * @access  public
  */
 function DataGrid($data, $caption = '', $id = '')
 {
     $this->_columns = array();
     $this->_caption = $caption;
     $this->_actionColumns = array();
     $this->_data = array();
     $this->_pagerLabels = array('first' => 'First', 'prev' => 'Previous', 'next' => 'Next', 'last' => 'Last');
     $this->_class = Piwi::getVarConf('DATAGRID_CLASS_CSS');
     if (empty($this->_class)) {
         $this->_class = 'datagrid';
     }
     $this->_actionLabel = Piwi::getVarConf('DATAGRID_ACTION_LABEL');
     if (empty($this->_actionLabel)) {
         $this->_actionLabel = 'Actions';
     }
     $this->_actionStyle = '';
     $this->_pagerSize = Piwi::getVarConf('DATAGRID_PAGER_PAGEBY');
     if (empty($this->_pagerSize)) {
         $this->_pagerSize = 10;
     }
     if (empty($id)) {
         $this->_id = 'datagrid_' . rand(1, 100);
     } else {
         $this->_id = $id;
     }
     if (is_array($data)) {
         $this->_data = $data;
     } else {
         die("The data provided to " . $this->getId() . " is not an array.");
     }
     $oddColor = Piwi::getVarConf('COLOR_ODD');
     if (empty($oddColor)) {
         $oddColor = '#edf3fe';
     }
     $this->setOddColor($oddColor);
     $evenColor = Piwi::getVarConf('COLOR_EVEN');
     if (empty($evenColor)) {
         $evenColor = '#fff';
     }
     $this->setEvenColor($evenColor);
     $this->addData($data);
     $pagerMode = Piwi::getVarConf('DATAGRID_PAGER_MODE');
     $pagerFirstAction = Piwi::getVarConf('DATAGRID_PAGER_FIRSTACTION');
     $pagerPrevAction = Piwi::getVarConf('DATAGRID_PAGER_PREVACTION');
     $pagerNextAction = Piwi::getVarConf('DATAGRID_PAGER_NEXTACTION');
     $pagerLastAction = Piwi::getVarConf('DATAGRID_PAGER_LASTACTION');
     $pagerGotoAction = Piwi::getVarConf('DATAGRID_PAGER_GOTOACTION');
     if (!empty($pagerMode)) {
         if (defined($pagerMode)) {
             $pagerMode = constant($pagerMode);
         }
         $this->usePager($pagerMode);
     }
     $this->setAction('first', $pagerFirstAction);
     $this->setAction('prev', $pagerPrevAction);
     $this->setAction('next', $pagerNextAction);
     $this->setAction('last', $pagerLastAction);
     $this->setAction('goto', $pagerGotoAction);
     $firstLabel = Piwi::getVarConf('DATAGRID_PAGER_LABEL_FIRST');
     if (!empty($firstLabel)) {
         $this->setLabelString('first', $firstLabel);
     }
     $prevLabel = Piwi::getVarConf('DATAGRID_PAGER_LABEL_PREV');
     if (!empty($prevLabel)) {
         $this->setLabelString('prev', $prevLabel);
     }
     $nextLabel = Piwi::getVarConf('DATAGRID_PAGER_LABEL_NEXT');
     if (!empty($nextLabel)) {
         $this->setLabelString('next', $nextLabel);
     }
     $lastLabel = Piwi::getVarConf('DATAGRID_PAGER_LABEL_LAST');
     if (!empty($lastLabel)) {
         $this->setLabelString('last', $lastLabel);
     }
     $this->_dataActions['onLoading'] = Piwi::getVarConf('DATAGRID_DATA_ONLOADING');
     $this->_dataActions['onLoaded'] = Piwi::getVarConf('DATAGRID_DATA_ONLOADED');
     parent::init();
 }
Exemplo n.º 6
0
 /**
  * Set the image 
  *
  * @access   public
  * @param    string $image SRC of image (or STOCK)
  */
 function setImage($image)
 {
     $this->_image = substr($image, 0, 1) == '?' || substr($image, 0, 7) == 'http://' || substr($image, 0, 8) == 'https://' ? $image : Piwi::getVarConf('LINK_PRIFIX') . $image;
     if (!empty($this->_image)) {
         $this->_hideText = true;
     }
 }