Exemplo n.º 1
0
 /**
  * Constructor
  * @param	object    $object   reference to targetobject (@link icms_ipf_Object)
  * @param	string    $key      the form name
  */
 public function __construct($object, $key)
 {
     icms_loadLanguageFile('system', 'blocksadmin', TRUE);
     parent::__construct(_AM_VISIBLEIN, ' ', $key . '_visiblein_tray');
     $visible_label = new icms_form_elements_Label('', '<select name="visiblein[]" id="visiblein[]" multiple="multiple" size="10">' . $this->getPageSelOptions($object->getVar('visiblein')) . '</select>');
     $this->addElement($visible_label);
 }
Exemplo n.º 2
0
 /**
  * Constructor
  * @param	object    $object   reference to targetobject (@link icms_ipf_Object)
  * @param	string    $key      the form name
  */
 public function __construct($object, $key)
 {
     $var = $object->vars[$key];
     $control = $object->getControl($key);
     $object_imageurl = $object->getImageDir();
     parent::__construct($var['form_caption'], ' ');
     if (isset($objectArray['image'])) {
         $objectArray['image'] = str_replace('{ICMS_URL}', ICMS_URL, $objectArray['image']);
     }
     if ($object->getVar($key, 'e') != '' && (substr($object->getVar($key, 'e'), 0, 4) == 'http' || substr($object->getVar($key, 'e'), 0, 11) == '{ICMS_URL}')) {
         $this->addElement(new icms_form_elements_Label('', "<img src='" . str_replace('{ICMS_URL}', ICMS_URL, $object->getVar($key, 'e')) . "' alt='' /><br/><br/>"));
     } elseif ($object->getVar($key, 'e') != '') {
         $this->addElement(new icms_form_elements_Label('', "<img src='" . $object_imageurl . $object->getVar($key, 'e') . "' alt='' /><br/><br/>"));
     }
     $this->addElement(new icms_ipf_form_elements_Fileupload($object, $key));
     if (!isset($control['nourl']) || !$control['nourl']) {
         $this->addElement(new icms_form_elements_Label('<div style="padding-top: 8px; font-size: 80%;">' . _CO_ICMS_URL_FILE_DSC . '</div>', ''));
         $this->addElement(new icms_form_elements_Label('', '<br />' . _CO_ICMS_URL_FILE));
         $this->addElement(new icms_form_elements_Text('', 'url_' . $key, 50, 500));
     }
     if (!$object->isNew()) {
         $this->addElement(new icms_form_elements_Label('', '<br /><br />'));
         $delete_check = new icms_form_elements_Checkbox('', 'delete_' . $key);
         $delete_check->addOption(1, '<span style="color:red;">' . _CO_ICMS_DELETE . '</span>');
         $this->addElement($delete_check);
     }
 }
Exemplo n.º 3
0
 /**
  * Constructor
  * @param	icms_ipf_Object	$object	target object
  * @param	string			$key	the key
  */
 public function __construct($object, $key)
 {
     parent::__construct($object->vars[$key]['form_caption'], "&nbsp;");
     $fileObj = $object->getFileObj($key);
     $module_handler = icms::handler("icms_module");
     $module = $module_handler->getByDirname($object->handler->_moduleName);
     if ($fileObj->getVar("url") != "") {
         $this->addElement(new icms_form_elements_Label("", _CO_ICMS_CURRENT_FILE . $fileObj->render() . "<br /><br />"));
     }
     if ($fileObj->isNew()) {
         $this->addElement(new icms_ipf_form_elements_Fileupload($fileObj, $key));
         $this->addElement(new icms_form_elements_Label("", "<br /><br /><small>" . _CO_ICMS_URL_FILE_DSC . "</small>"));
         $this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_URL_FILE));
         $this->addElement(new icms_ipf_form_elements_Text($fileObj, "url_" . $key));
     }
     $this->addElement(new icms_form_elements_Hidden("mid_" . $key, $module->getVar("mid")));
     $this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_CAPTION));
     $this->addElement(new icms_ipf_form_elements_Text($fileObj, "caption_" . $key));
     $this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_DESC));
     $this->addElement(new icms_ipf_form_elements_Text($fileObj, "desc_" . $key));
     if (!$fileObj->isNew()) {
         $this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_CHANGE_FILE));
         $this->addElement(new icms_ipf_form_elements_Fileupload($fileObj, $key));
         $this->addElement(new icms_form_elements_Label("", "<br /><br /><small>" . _CO_ICMS_URL_FILE_DSC . "</small>"));
         $this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_URL_FILE));
         $this->addElement(new icms_ipf_form_elements_Text($fileObj, "url_" . $key));
     }
 }
Exemplo n.º 4
0
 /**
  * Constructor
  * @param	object    $object   reference to targetobject (@link icms_ipf_Object)
  * @param	string    $key      the form name
  */
 public function __construct($object, $key)
 {
     $var = $object->vars[$key];
     $control = $object->controls[$key];
     icms_loadLanguageFile('core', 'user');
     parent::__construct($var['form_caption'] . '<br />' . _US_TYPEPASSTWICE, ' ', $key . '_password_tray');
     $password_box1 = new icms_form_elements_Password('', $key . '1', 10, 32, '', FALSE, "password_adv");
     $this->addElement($password_box1);
     $this->_key = $key;
 }
Exemplo n.º 5
0
 /**
  * Constructor
  * @param	object    $object   reference to targetobject (@link icms_ipf_Object)
  * @param	string    $key      the form name
  */
 public function __construct($object, $key)
 {
     $var = $object->vars[$key];
     parent::__construct($var['form_caption'], '<br /><br />', $key . '_signature_tray');
     icms_loadLanguageFile('core', 'user');
     $signature_textarea = new icms_form_elements_Dhtmltextarea('', $key, $object->getVar($key, 'e'));
     $this->addElement($signature_textarea);
     $attach_checkbox = new icms_form_elements_Checkbox('', 'attachsig', $object->getVar('attachsig', 'e'));
     $attach_checkbox->addOption(1, _US_SHOWSIG);
     $this->addElement($attach_checkbox);
 }
Exemplo n.º 6
0
 /**
  * Constructor
  * @param	object    $object   reference to targetobject (@link icms_ipf_Object)
  * @param	string    $key      the form name
  */
 public function __construct($object, $key)
 {
     $var = $object->vars[$key];
     parent::__construct($var['form_caption'], ' ', 'options_tray');
     $func = $object->getVar('edit_func');
     require_once ICMS_ROOT_PATH . "/modules/" . $object->handler->getModuleDirname($object->getVar('mid', 'e')) . "/blocks/" . $object->getVar('func_file');
     icms_loadLanguageFile($object->handler->getModuleDirname($object->getVar('mid', 'e')), 'blocks');
     if (!function_exists($func)) {
         return;
     }
     $visible_label = new icms_form_elements_Label('', $func(explode('|', $object->getVar('options'))));
     $this->addElement($visible_label);
 }
Exemplo n.º 7
0
    /**
     * Constructor
     *
     * @param	object	$form	the form calling the editor selection
     * @param	string	$name	editor name
     * @param	string	$value	Pre-selected text value
     * @param	bool	$noHtml  dohtml disabled
     */
    public function __construct(&$form, $name = "editor", $value = NULL, $noHtml = FALSE)
    {
        global $icmsConfig;
        if (empty($value)) {
            $value = $icmsConfig['editor_default'];
        }
        parent::__construct(_SELECT);
        $edtlist = icms_plugins_EditorHandler::getListByType();
        $option_select = new icms_form_elements_Select("", $name, $value);
        $querys = preg_replace('/editor=(.*?)&/', '', $_SERVER['QUERY_STRING']);
        $extra = 'onchange="if(this.options[this.selectedIndex].value.length > 0 ){
				window.location = \'?editor=\'+this.options[this.selectedIndex].value+\'&' . $querys . '\';
			}"';
        $option_select->setExtra($extra);
        $option_select->addOptionArray($edtlist);
        $this->addElement($option_select);
    }
Exemplo n.º 8
0
 /**
  * Constructor
  * @param	string  $caption    Caption of the element
  * @param	string  $name       Name of the element
  * @param	string  $size       Size of the element
  * @param	string  $value      Value of the element
  */
 public function __construct($caption, $name, $size = 15, $value = 0)
 {
     parent::__construct($caption, '&nbsp;');
     $value = (int) $value;
     $value = $value > 0 ? $value : time();
     $datetime = getDate($value);
     $this->addElement(new icms_form_elements_Date('', $name . '[date]', $size, $value));
     $timearray = array();
     for ($i = 0; $i < 24; $i++) {
         for ($j = 0; $j < 60; $j = $j + 10) {
             $key = $i * 3600 + $j * 60;
             $timearray[$key] = $j != 0 ? $i . ':' . $j : $i . ':0' . $j;
         }
     }
     ksort($timearray);
     $timeselect = new icms_form_elements_Select('', $name . '[time]', $datetime['hours'] * 3600 + 600 * ceil($datetime['minutes'] / 10));
     $timeselect->addOptionArray($timearray);
     $this->addElement($timeselect);
 }
Exemplo n.º 9
0
 /**
  * Constructor
  * @param	icms_ipf_Object	$object	target object
  * @param	string			$key	the key
  */
 public function __construct($object, $key)
 {
     parent::__construct($object->vars[$key]['form_caption'], "&nbsp;");
     $urllinkObj = $object->getUrlLinkObj($key);
     $module_handler = icms::handler("icms_module");
     $module = $module_handler->getByDirname($object->handler->_moduleName);
     $this->addElement(new icms_form_elements_Label("", _CO_ICMS_URLLINK_URL));
     $this->addElement(new icms_ipf_form_elements_Text($urllinkObj, "url_" . $key));
     $this->addElement(new icms_form_elements_Label("", "<br/>" . _CO_ICMS_CAPTION));
     $this->addElement(new icms_ipf_form_elements_Text($urllinkObj, "caption_" . $key));
     $this->addElement(new icms_form_elements_Label("", "<br/>" . _CO_ICMS_DESC));
     $this->addElement(new icms_ipf_form_elements_Text($urllinkObj, "desc_" . $key));
     $this->addElement(new icms_form_elements_Label("", "<br/>" . _CO_ICMS_URLLINK_TARGET));
     $this->addElement(new icms_form_elements_Hidden("mid_" . $key, $module->getVar("mid")));
     $targ_val = $urllinkObj->getVar("target");
     $targetRadio = new icms_form_elements_Radio("", "target_" . $key, $targ_val != "" ? $targ_val : "_blank");
     $control = $urllinkObj->getControl("target");
     $targetRadio->addOptionArray($control["options"]);
     $this->addElement($targetRadio);
 }
Exemplo n.º 10
0
 /**
  * Constructor
  *
  * @param	string	$caption
  * @param	string	$name
  * @param	mixed	$value			Pre-selected value (or array of them).
  *									For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item
  * @param	bool	$include_anon	Include user "anonymous"?
  * @param	int		$size			Number or rows. "1" makes a drop-down-list.
  * @param	bool	$multiple	   Allow multiple selections?
  */
 public function __construct($caption, $name, $include_anon = FALSE, $value = NULL, $size = 1, $multiple = FALSE, $showremovedusers = FALSE, $justremovedusers = FALSE)
 {
     $limit = 200;
     $select_element = new icms_form_elements_Select('', $name, $value, $size, $multiple);
     if ($include_anon) {
         $select_element->addOption(0, $GLOBALS['icmsConfig']['anonymous']);
     }
     $member_handler = icms::handler('icms_member');
     $user_count = $member_handler->getUserCount();
     $value = is_array($value) ? $value : (empty($value) ? array() : array($value));
     if ($user_count > $limit && count($value) > 0) {
         $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item("uid", "(" . implode(",", $value) . ")", "IN"));
     } else {
         $criteria = new icms_db_criteria_Compo();
         $criteria->setLimit($limit);
     }
     $criteria->setSort('uname');
     if (!$showremovedusers) {
         $criteria->add(new icms_db_criteria_Item('level', '-1', '!='));
     } elseif ($showremovedusers && $justremovedusers) {
         $criteria->add(new icms_db_criteria_Item('level', '-1'));
     }
     $criteria->setOrder('ASC');
     $users = $member_handler->getUserList($criteria);
     $select_element->addOptionArray($users);
     if ($user_count <= $limit) {
         parent::__construct($caption, "", $name);
         $this->addElement($select_element);
         return;
     }
     icms_loadLanguageFile('core', 'findusers');
     $js_addusers = "<script type=\"text/javascript\">\r\n\t\t\t\t\tfunction addusers(opts){\r\n\t\t\t\t\t\tvar num = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\tvar sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");\r\n\t\t\t\t\t\tvar arr = new Array(num);\r\n\t\t\t\t\t\tfor (var n=0; n < num; n++) {\r\n\t\t\t\t\t\t\tvar nm = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\t\tvar val = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\t\tvar txt = opts.substring(0, nm - val.length);\r\n\t\t\t\t\t\t\topts = opts.substring(nm - val.length, opts.length);\r\n\t\t\t\t\t\t\tvar added = false;\r\n\t\t\t\t\t\t\tfor (var k = 0; k < sel.options.length; k++) {\r\n\t\t\t\t\t\t\t\tif (sel.options[k].value == val){\r\n\t\t\t\t\t\t\t\t\tadded = true;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (added == false) {\r\n\t\t\t\t\t\t\t\tsel.options[k] = new Option(txt, val);\r\n\t\t\t\t\t\t\t\tsel.options[k].selected = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t</script>";
     $token = icms::$security->createToken();
     $action_tray = new icms_form_elements_Tray("", " | ");
     $action_tray->addElement(new icms_form_elements_Label('', "<a href='#' onclick='var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;'>" . _MA_USER_REMOVE . "</a>"));
     $action_tray->addElement(new icms_form_elements_Label('', "<a href='#' onclick='openWithSelfMain(\"" . ICMS_URL . "/include/findusers.php?target={$name}&amp;multiple={$multiple}&amp;token={$token}\", \"userselect\", 800, 600, null); return false;' >" . _MA_USER_MORE . "</a>" . $js_addusers));
     parent::__construct($caption, '<br /><br />', $name);
     $this->addElement($select_element);
     $this->addElement($action_tray);
 }