public static function show_title_dialog($title, $post_action = null)
 {
     $defs = array();
     //        ControlFactory::add_vgap($defs, 50);
     ControlFactory::add_custom_close_dialog_and_apply_buffon($defs, 'apply_subscription', 'OK', 300, $post_action);
     return self::show_dialog($title, $defs);
 }
 /**
  * @access public
  * @param string
  * @param string
  */
 function register($type, $className)
 {
     $instance =& ControlFactory::getInstance();
     if (!class_exists($className)) {
         Amber::showError('Warning', 'Missing declaration for class "' . $className . '", control type = ' . $type);
         return false;
     }
     $instance->_classList[$type] = $className;
 }
 protected function add_combobox(&$defs, $name, $title, $initial_value, $value_caption_pairs, $width, $need_confirm = false, $need_apply = false)
 {
     ControlFactory::add_combobox($defs, $this, null, $name, $title, $initial_value, $value_caption_pairs, $width, $need_confirm, $need_apply);
 }
 private function do_get_edit_subscription_defs(&$plugin_cookies, $handler, $add_params)
 {
     $defs = array();
     $user_name = isset($plugin_cookies->user_name) ? $plugin_cookies->user_name : '';
     $password = isset($plugin_cookies->password) ? $plugin_cookies->password : '';
     ControlFactory::add_text_field($defs, $handler, $add_params, 'user_name', 'Subscription:', $user_name, true, false, false, 500);
     ControlFactory::add_text_field($defs, $handler, $add_params, 'password', 'Password:'******'apply_subscription', null, 'Apply', 300);
     ControlFactory::add_vgap($defs, -3);
     ControlFactory::add_close_dialog_button($defs, 'Cancel', 300);
     return $defs;
 }
Example #5
0
 /**
  *
  * @access public
  * @param Report
  * @param array XML data
  *
  */
 function load(&$parent, $data)
 {
     $this->_parent =& $parent;
     $this->Name = $data['Name'];
     $this->Height = empty($data['Height']) ? 0 : $data['Height'];
     $this->ForceNewPage = empty($data['ForceNewPage']) ? 0 : $data['ForceNewPage'];
     if (isset($data['Visible'])) {
         $this->Visible = $data['Visible'];
     }
     if (isset($data['BackColor'])) {
         $this->BackColor = MSColor($data['BackColor']);
     }
     if (isset($data['CanGrow'])) {
         $this->CanGrow = $data['CanGrow'];
     }
     if (isset($data['CanShrink'])) {
         $this->CanShrink = $data['CanShrink'];
     }
     if (isset($data['KeepTogether'])) {
         $this->KeepTogether = $data['KeepTogether'];
     }
     if (isset($data['EventProcPrefix'])) {
         $this->EventProcPrefix = $data['EventProcPrefix'];
     } else {
         $this->EventProcPrefix = $data['Name'];
     }
     $s = $data['EventProcPrefix'] . '_Format';
     if (method_exists($this->_parent->_Code, $s)) {
         $this->_OnFormatFunc = $s;
     } else {
         $this->_OnFormatFunc = 'allSections_Format';
         // null-OnFormat
     }
     $s = $data['EventProcPrefix'] . '_Print';
     if (method_exists($this->_parent->_Code, $s)) {
         $this->_OnPrintFunc = $s;
     } else {
         $this->_OnPrintFunc = 'allSections_Print';
         // null-OnPrint
     }
     if (!empty($data['Controls'])) {
         foreach ($data['Controls'] as $c) {
             $ctl =& ControlFactory::create($c['ControlType'], $c, $parent->hReport);
             if ($ctl == false) {
                 Amber::showError('Warning', 'Skipping unsupported control type: ' . htmlentities($c['ControlType']));
             } else {
                 $this->Controls[] =& $ctl;
                 $parent->Controls[$ctl->Name] =& $ctl;
                 $parent->ControlValues[$ctl->Name] =& $ctl->Value;
                 $ctl->_SectionSlip =& $parent->SectionSlip;
             }
         }
     }
 }
Example #6
0
 public static function show_default_filter_selecor_modal($modalTitle, &$plugin_cookies, $post_action = null)
 {
     $defs = array();
     $movieFilters = array("all" => "All", "unwatched" => "Unwatched", "newest" => "Recently Released", "recentlyAdded" => "Recently Added", "recentlyViewed" => "Recently Viewed", "onDeck" => "On Deck", "collection" => "By Collection", "genre" => "By Genre", "year" => "By Year", "decade" => "By Decade", "director" => "By Director", "actor" => "By Starring Actor", "country" => "By Country", "contentRating" => "By Content Rating", "rating" => "By Rating", "resolution" => "By Resolution", "firstCharacter" => "By First Letter", "folder" => "By Folder");
     $showFilters = array("all" => "All", "unwatched" => "Unwatched", "newest" => "Recently Aired", "recentlyAdded" => "Recently Added", "recentlyViewed" => "Recently Viewed Episodes", "recentlyViewedShows" => "Recently Viewed Shows", "onDeck" => "On Deck", "collection" => "By Collection", "firstCharacter" => "By First Letter", "genre" => "By Genre", "year" => "By Year", "contentRating" => "By Content Rating", "folder" => "By Folder");
     $artistFilters = array("all" => "All Artists", "albums" => "By Album", "genre" => "By Genre", "decade" => "By Decade", "year" => "By Year", "collection" => "By Collection", "recentlyAdded" => "Recently Added", "folder" => "By Folder");
     ControlFactory::add_combobox($defs, null, null, $name = 'defaultMovieFilter', $title = 'Default movie filter', $initial_value = isset($plugin_cookies->defaultMovieFilter) ? $plugin_cookies->defaultMovieFilter : 'all', $value_caption_pairs = $movieFilters, $width = 600, $need_confirm = false, $need_apply = false);
     ControlFactory::add_combobox($defs, null, null, $name = 'defaultShowFilter', $title = 'Default show filter', $initial_value = isset($plugin_cookies->defaultShowFilter) ? $plugin_cookies->defaultShowFilter : 'all', $value_caption_pairs = $showFilters, $width = 600, $need_confirm = false, $need_apply = false);
     ControlFactory::add_combobox($defs, null, null, $name = 'defaultArtistFilter', $title = 'Default music filter', $initial_value = isset($plugin_cookies->defaultArtistFilter) ? $plugin_cookies->defaultArtistFilter : 'all', $value_caption_pairs = $artistFilters, $width = 600, $need_confirm = false, $need_apply = false);
     ControlFactory::add_custom_close_dialog_and_apply_buffon($defs, 'saveDefaultFilters', 'save', 200, $post_action);
     return ActionFactory::show_dialog($modalTitle, $defs);
 }
Example #7
0
 public function parseNode(\DOMNode $node, $parent = null)
 {
     if ($this->webform === null) {
         return;
     }
     $name = $node->nodeName;
     $attribs = $node->attributes;
     switch ($name) {
         case 'area':
             $label = $this->getText($attribs->getNamedItem('label')->value);
             $area = new Area($this->webform, $label);
             if ($attribs->getNamedItem('id')->value != null) {
                 $area->setId($attribs->getNamedItem('id')->value);
             }
             if ($parent == null) {
                 $this->webform->addArea($area);
             } else {
                 $parent->addArea($area);
             }
             $this->parseChilds($node, $area);
             break;
         case 'control':
             $type = $attribs->getNamedItem('type')->value;
             $control = ControlFactory::createControl($type, $parent);
             $control->setLabel(($attrib = $attribs->getNamedItem('label')) !== null ? $this->getText($attrib->value) : '');
             $control->setName(($attrib = $attribs->getNamedItem('name')) !== null ? $attrib->value : '');
             $control->setDescription(($attrib = $attribs->getNamedItem('description')) !== null ? $this->getText($attrib->value) : '');
             $control->setDefault(($attrib = $attribs->getNamedItem('default')) !== null ? $this->getText($attrib->value) : '');
             $control->setTitle(($attrib = $attribs->getNamedItem('title')) !== null ? $this->getText($attrib->value) : '');
             $control->setRequired(($attrib = $attribs->getNamedItem('required')) !== null ? $attrib->value == 'yes' ? true : false : '');
             if ($attribs->getNamedItem('id')->value != null) {
                 $control->setId($attribs->getNamedItem('id')->value);
             }
             /* Special cases */
             switch ($type) {
                 case 'MultiLine':
                     $control->setRows($attribs->getNamedItem('rows')->value);
                     break;
                 case 'Group':
                     $control->setDirection($attribs->getNamedItem('direction')->value);
                     $this->parseChilds($node, $control);
                     break;
                 case 'Radio':
                 case 'CheckBox':
                     $control->setChecked($attribs->getNamedItem('checked')->value == 'yes');
                     break;
                 case 'ComboBox':
                     $options = $node->childNodes;
                     for ($i = 0; $i < $options->length; $i++) {
                         $option = $options->item($i);
                         if ($option->nodeType == XML_ELEMENT_NODE) {
                             $optionAttribs = $option->attributes;
                             $label = $this->getText($optionAttribs->getNamedItem('label')->value);
                             $value = $optionAttribs->getNamedItem('value')->value;
                             $checked = $optionAttribs->getNamedItem('checked')->value == 'yes';
                             $control->addOption($value, $label, $checked);
                         }
                     }
                     break;
             }
             $parent->addControl($control);
             $this->parseValidator($node, $control);
             break;
     }
 }
 public function showSearchScreen($key, $title, &$plugin_cookies)
 {
     hd_print(__METHOD__);
     // $base_url = EmplexerConfig::getInstance()->getPlexBaseUrl($plugin_cookies, $this);
     $url = $this->base_url . $key;
     $defs = array();
     ControlFactory::add_text_field($defs, null, null, $name = 'query', $title = $title, $initial_value = "", $numeric = false, $password = false, $has_osk = false, $always_active = 0, $width = 500);
     $params['key'] = $key;
     $searchAction = UserInputHandlerRegistry::create_action($this, 'search', $params);
     ControlFactory::add_custom_close_dialog_and_apply_buffon($defs, 'search', 'Search', 100, $searchAction);
     $dialog = ActionFactory::show_dialog('Search', $defs);
     // hd_print("search = " . print_r($dialog, true));
     return $dialog;
 }
Example #9
0
/**
*
* @package Amber
* @subpackage Controls
*
*/
ControlFactory::register('100', 'Label');
ControlFactory::register('101', 'Rectangle');
ControlFactory::register('102', 'Dummy');
// Line
//ControlFactory::register('104', 'CommandButton');
ControlFactory::register('106', 'CheckBox');
ControlFactory::register('109', 'TextBox');
ControlFactory::register('111', 'Dummy');
// ComboBox
ControlFactory::register('112', 'SubReport');
//ControlFactory::register('122', 'ToggleButton');
/**
*
* @package Amber
* @subpackage Controls
*
*/
class Control
{
    var $id;
    // unique numeric id
    var $Properties = array('Name' => '', 'EventProcPrefix' => '', 'ControlType' => 0, 'Left' => 0, 'Top' => 0, 'Width' => 0, 'Height' => 0, 'Visible' => true, 'BackStyle' => 0, 'BackColor' => 16777215, 'BorderStyle' => 0, 'BorderColor' => 0, 'BorderWidth' => 0, 'BorderLineStyle' => 0, 'zIndex' => 0, 'Value' => '', '_OldValue' => '');
    var $_exporter;
    var $_hReport;
    /**
Example #10
0
 /**
  * @access protected
  */
 function initDesignHeader()
 {
     $this->_designSection =& new section('');
     $this->_designSection->Name = '<designBorder>';
     $this->_designSection->Height = 240;
     $this->_designSection->Visible = true;
     $this->_designSection->BackColor = 0xffffff;
     $this->_designSection->CanGrow = false;
     $this->_designSection->CanShrink = false;
     $this->_designSection->KeepTogether = false;
     $this->_designSection->EventProcPrefix = '';
     $this->_designSection->_parent =& $this;
     $this->_designSection->_OnFormatFunc = 'allSections_Format';
     $ctlProp = array('Name' => '', 'Left' => 0, 'Top' => 0, 'Width' => $this->Width, 'Height' => 240, 'Visible' => true, 'BackStyle' => 1, 'BackColor' => 0xdddddd, 'BorderStyle' => 0, 'BorderColor' => 0, 'BorderWidth' => 1, 'BorderLineStyle' => 0, 'zIndex' => 0, 'Value' => '', '_OldValue' => '', 'ForeColor' => 0x0, 'FontName' => 'Arial', 'FontSize' => 8, 'FontWeight' => 500, 'TextAlign' => 0, 'FontItalic' => false, 'FontUnderline' => false, 'Caption' => 'Test');
     $ctl =& ControlFactory::create(100, $ctlProp, $this->hReport);
     $this->_exporter->setControlExporter($ctl);
     $this->_designSection->Controls['label'] =& $ctl;
 }