Пример #1
0
 public function __construct($app)
 {
     $this->app = $app;
     $this->container = new Container();
     $this->defineEnv($this->container);
     $this->defineApp();
     $this->container->init();
     Profile::Checkpoint('Container has been Created');
 }
Пример #2
0
 /**
  * Public constructor
  *
  * @param    string   $value  The Name (title)
  * @param    string   $action The action to execute when it gets a mouse click
  * @param    strng    $icon   If you want to add an image to the MenuItem
  * @access   public
  */
 function MenuItem($value, $action = '', $icon = '')
 {
     $this->_value = $value;
     $this->_action = $action;
     $this->_icon = $icon;
     $this->childs = array();
     parent::init();
 }
Пример #3
0
 /**
  * Public constructor
  *
  * @access   public
  */
 function FieldSet($legend = '')
 {
     $this->_name = 'fieldset' . rand(1, 100);
     $this->_direction = 'horizontal';
     $this->_legendID = '';
     $this->setLegend($legend);
     parent::init();
 }
Пример #4
0
 /**
  * Public Constructor
  *
  * @param  string    $id     ID of the viewport
  * @param  string    $width  Width of the viewport
  * @param  string    $height Height of the Viewport
  * @access public
  */
 function ViewPort($id = 'viewport', $width = 300, $height = 150)
 {
     $this->_id = $id;
     $this->_width = $width;
     $this->_height = $height;
     if (empty($this->_id)) {
         $this->_id = 'viewport_' . rand(1, 100);
     }
     parent::init();
 }
Пример #5
0
 /**
  * Public constructor
  *
  * @param    string   $id   The ID of the div that will have the menubar.
  *                          if you are using another menubar, you should give it another ID and
  *                          another CSS sheet!
  * @access   public
  */
 function MenuBar($id = 'menubar')
 {
     $this->_id = $id;
     $this->_paths = array();
     $this->_class = 'ddmx';
     if (empty($this->_id)) {
         die("Menubar should have an id!");
     }
     parent::init();
 }
Пример #6
0
 function DataGridCapture($numrows, $numcolumns, $titles, $gadget, $action, $entry_type, $caption = '', $id = '')
 {
     $this->_name = 'datagridcapture';
     $this->_class = 'datagrid';
     $this->_columns = array();
     $this->_caption = $caption;
     $this->_actionColumns = array();
     $this->_data = array();
     if (empty($id)) {
         $this->_id = 'datagridcapture_' . rand(1, 100);
     } else {
         $this->_id = $id;
     }
     /*if (is_array($data)) {
           $this->_data = $data;
       } else {
           die("beh!");
       }
       */
     $this->setOddColor('#eee');
     $this->setEvenColor('#fff');
     for ($id = 0; $id < $numrows; $id++) {
         $idtext = $this->_id . '_' . $id;
         $keyField1 = new Entry('name_' . $idtext, str_replace('"', '&quot;', ''));
         #$keyField->setStyle('background: transparent;border-style: solid; border: 10px;');
         $keyField1->setStyle('border-style: solid; border: 10px;');
         $keyField1->setEnabled(true);
         $keyField1->setSize(30);
         $data[$id]['key'] = $keyField1->get();
         $keyField2 = new Entry('value_' . $idtext, str_replace('"', '&quot;', ''));
         $keyField2->setStyle('background: transparent; border: 1px;');
         $keyField2->setEnabled(true);
         $keyField2->setSize(30);
         $data[$id]['value'] = $keyField2->get();
         $data[$id]['action'] = '<a OnClick="javascript: if(confirm(\'Are this values correct?\')) { window.location=\'?gadget=' . $gadget . '&action=' . $action . '&id=' . $id . '&key=\'+document.getElementById(\'' . $keyField1->getID() . '\').value+\'&value=\'+document.getElementById(\'' . $keyField2->getID() . '\').value+\'&entry_type=' . $entry_type . '\';}"><img id="imgcat' . $id . '" src="images/stock/save.png" border="0" alt="" /></a>';
     }
     parent::init();
     foreach ($titles as $t) {
         $this->addColumn(new Column(_("{$t}"), "{$t}", true));
     }
     $this->addData($data);
 }
Пример #7
0
 /**
  * Main Constructor
  *
  * @access  public
  * @param   string  $gadget Gadget name
  * @param   string  $name   Name of editor
  * @param   string  $value  Default content of editor
  * @param   string  $label  Label/Title of editor
  * @return  void
  */
 function Jaws_Widgets_CKEditor($gadget, $name, $value = '', $label = '')
 {
     require_once JAWS_PATH . 'include/Jaws/String.php';
     $value = str_replace('&lt;', '&amp;lt;', $value);
     $value = str_replace('&gt;', '&amp;gt;', $value);
     $this->_Name = $name;
     $this->_Value = $value;
     $this->_Gadget = $gadget;
     // set toolbar options
     if (JAWS_SCRIPT == 'admin') {
         $toolbars = $GLOBALS['app']->Registry->fetch('editor_ckeditor_backend_toolbar', 'Settings');
     } else {
         $toolbars = $GLOBALS['app']->Registry->fetch('editor_ckeditor_frontend_toolbar', 'Settings');
     }
     $toolbars = array_filter(explode('|', $toolbars));
     foreach ($toolbars as $key => $items) {
         $items = array_values(array_filter(explode(',', $items)));
         if (!empty($items)) {
             $this->toolbars[] = $items;
         }
     }
     $this->TextArea =& Piwi::CreateWidget('TextArea', $this->_Name, $this->_Value);
     $this->TextArea->setClass($name);
     $this->TextArea->setID($this->_Name);
     $this->TextArea->setName($this->_Name);
     $this->_Label =& Piwi::CreateWidget('Label', $label, $this->TextArea);
     $this->_BasePath = 'libraries/ckeditor/';
     $this->_Language = $GLOBALS['app']->GetLanguage();
     $this->_Direction = _t('GLOBAL_LANG_DIRECTION');
     $this->_Container =& Piwi::CreateWidget('Division');
     $this->_Container->setClass('jaws_editor');
     parent::init();
 }
Пример #8
0
 /**
  * Main Constructor
  *
  * @access  public
  * @param   string  $gadget
  * @param   string  $name
  * @param   string  $value
  * @param   string  $label
  * @return  void
  */
 function Jaws_Widgets_TinyMCE($gadget, $name, $value = '', $label = '')
 {
     require_once JAWS_PATH . 'include/Jaws/String.php';
     //$value = Jaws_String::AutoParagraph($value);
     $value = str_replace('&lt;', '&amp;lt;', $value);
     $value = str_replace('&gt;', '&amp;gt;', $value);
     $this->_Name = $name;
     $this->_Value = $value;
     $this->_Gadget = $gadget;
     if (JAWS_SCRIPT == 'admin') {
         $this->toolbars[] = $GLOBALS['app']->Registry->fetch('editor_tinymce_backend_toolbar', 'Settings');
     } else {
         $this->toolbars[] = $GLOBALS['app']->Registry->fetch('editor_tinymce_frontend_toolbar', 'Settings');
     }
     $this->TextArea =& Piwi::CreateWidget('TextArea', $name, $this->_Value, '', '14');
     $this->_Label =& Piwi::CreateWidget('Label', $label, $this->TextArea);
     $this->setClass($name);
     $this->_Container =& Piwi::CreateWidget('Division');
     $this->_Container->SetClass('jaws_editor');
     parent::init();
 }
Пример #9
0
 /**
  * Makes and IoC-container, that is: gives more functionality to a class with typehinting
  *
  * @param string $class    name of the class
  * @param string $method   name of the method
  * @param array  $args     arguments for this specify method
  * @param array  $main     arguments for the sub-methods
  *
  * @return mixed the result of the selected/created object
  */
 public static function container($class, $method = null, $args = [], $main = [])
 {
     return Container::init($class, $method, $args, $main);
 }
Пример #10
0
 /**
  * Public constructor
  *
  * @param    string  $action Action to use
  * @param    string  $method Method to use
  * @param    string  $encoding Encoding to use
  * @param    string  $id     Id of the form
  *
  * @access   public
  */
 function Form($action, $method = 'get', $encoding = '', $id = '')
 {
     $this->_action = $action;
     $this->_method = strtolower($method);
     $this->_hiddenItems = array();
     $this->_shouldValidate = false;
     $this->_customValidate = false;
     $this->encodeUrl(false);
     $this->setEncodingType($encoding);
     $this->setTableClass('tableform');
     if (empty($id)) {
         $this->_id = 'form_' . rand(1, 100);
     } else {
         $this->_id = $id;
     }
     parent::init();
 }
Пример #11
0
 /**
  * Main Constructor
  *
  * @access  public
  * @param   $gadget
  * @param   $name
  * @param   string  $value
  * @param   string  $label
  * @return  void
  */
 function Jaws_Widgets_TextArea($gadget, $name, $value = '', $label = '')
 {
     $this->_Name = $name;
     $this->_Value = $value;
     $this->_Gadget = $gadget;
     $this->_ToolbarControl =& Piwi::CreateWidget('Toolbar');
     $this->_ToolbarControl->SetID('toolbar_' . $name);
     $this->TextArea =& Piwi::CreateWidget('TextArea', $name, $value);
     $this->TextArea->SetClass('xx-large');
     $this->_Label =& Piwi::CreateWidget('Label', $label, $this->TextArea);
     $this->_Container =& Piwi::CreateWidget('Division');
     $this->_Container->SetClass('jaws_editor');
     $this->_Container->AddFile('include/Jaws/Resources/TextArea.js');
     parent::init();
     $this->setID($name);
 }
Пример #12
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();
 }
Пример #13
0
 /**
  * Public constructor
  *
  * @access public
  */
 function Toolbar()
 {
     parent::init();
 }