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];
     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.º 5
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);
 }
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
	$icq_tray = new icms_form_elements_Tray(_AM_ICQ, "&nbsp;");
	$icq_tray->addElement($icq_match);
	$icq_tray->addElement($icq_text);
	$aim_text = new icms_form_elements_Text("", "user_aim", 30, 100);
	$aim_match = new icms_form_elements_select_Matchoption("", "user_aim_match");
	$aim_tray = new icms_form_elements_Tray(_AM_AIM, "&nbsp;");
	$aim_tray->addElement($aim_match);
	$aim_tray->addElement($aim_text);
	$yim_text = new icms_form_elements_Text("", "user_yim", 30, 100);
	$yim_match = new icms_form_elements_select_Matchoption("", "user_yim_match");
	$yim_tray = new icms_form_elements_Tray(_AM_YIM, "&nbsp;");
	$yim_tray->addElement($yim_match);
	$yim_tray->addElement($yim_text);
	$msnm_text = new icms_form_elements_Text("", "user_msnm", 30, 100);
	$msnm_match = new icms_form_elements_select_Matchoption("", "user_msnm_match");
	$msnm_tray = new icms_form_elements_Tray(_AM_MSNM, "&nbsp;");
	$msnm_tray->addElement($msnm_match);
	$msnm_tray->addElement($msnm_text);
	$location_text = new icms_form_elements_Text(_AM_LOCATION, "user_from", 30, 100);
	$occupation_text = new icms_form_elements_Text(_AM_OCCUPATION, "user_occ", 30, 100);
	$interest_text = new icms_form_elements_Text(_AM_INTEREST, "user_intrest", 30, 100);

	//$bio_text = new icms_form_elements_Text(_AM_EXTRAINFO, "user_bio", 30, 100);
	$lastlog_more = new icms_form_elements_Text(_AM_LASTLOGMORE, "user_lastlog_more", 10, 5);
	$lastlog_less = new icms_form_elements_Text(_AM_LASTLOGLESS, "user_lastlog_less", 10, 5);
	$reg_more = new icms_form_elements_Text(_AM_REGMORE, "user_reg_more", 10, 5);
	$reg_less = new icms_form_elements_Text(_AM_REGLESS, "user_reg_less", 10, 5);
	$posts_more = new icms_form_elements_Text(_AM_POSTSMORE, "user_posts_more", 10, 5);
	$posts_less = new icms_form_elements_Text(_AM_POSTSLESS, "user_posts_less", 10, 5);
	$mailok_radio = new icms_form_elements_Radio(_AM_SHOWMAILOK, "user_mailok", "both");
	$mailok_radio->addOptionArray(array("mailok"=>_AM_MAILOK, "mailng"=>_AM_MAILNG, "both"=>_AM_BOTH));
Exemplo n.º 11
0
 public function render()
 {
     $ret = parent::render();
     $ret .= "<input type='password' name='" . $this->_key . "2' id='" . $this->_key . "2' " . "size='10' maxlength='32' value='' autocomplete='off' />";
     return $ret;
 }
Exemplo n.º 12
0
$reg_form->addElement(new icms_form_elements_Text(_US_NICKNAME, "uname", $uname_size, $uname_size, icms_core_DataFilter::htmlSpecialChars($uname)), true);
$login_name_size = $icmsConfigUser['maxuname'] < 75 ? $icmsConfigUser['maxuname'] : 75;
$reg_form->addElement(new icms_form_elements_Text(_US_LOGIN_NAME, "login_name", $login_name_size, $login_name_size, icms_core_DataFilter::htmlSpecialChars($login_name)), true);
$reg_form->addElement($email_tray);
if ($icmsConfigUser['pass_level'] > 20) {
    icms_PasswordMeter();
}
$reg_form->addElement(new icms_form_elements_Password(_US_PASSWORD, "pass", 10, 255, icms_core_DataFilter::htmlSpecialChars($pass), false, $icmsConfigUser['pass_level'] ? 'password_adv' : ''), true);
$reg_form->addElement(new icms_form_elements_Password(_US_VERIFYPASS, "vpass", 10, 255, icms_core_DataFilter::htmlSpecialChars($vpass)), true);
$reg_form->addElement(new icms_form_elements_Text(_US_WEBSITE, "url", 25, 255, icms_core_DataFilter::htmlSpecialChars($url)));
$tzselected = $timezone_offset != "" ? $timezone_offset : $icmsConfig['default_TZ'];
$reg_form->addElement(new icms_form_elements_select_Timezone(_US_TIMEZONE, "timezone_offset", $tzselected));
//$reg_form->addElement($avatar_tray);
$reg_form->addElement(new icms_form_elements_Radioyn(_US_MAILOK, 'user_mailok', $user_mailok));
if ($icmsConfigUser['reg_dispdsclmr'] != 0 && $icmsConfigUser['reg_disclaimer'] != '') {
    $disc_tray = new icms_form_elements_Tray(_US_DISCLAIMER, '<br />');
    $disclaimer_html = '<div id="disclaimer">' . nl2br($icmsConfigUser['reg_disclaimer']) . '</div>';
    $disc_text = new icms_form_elements_Label('', $disclaimer_html, 'disclaimer');
    $disc_tray->addElement($disc_text);
    $agree_chk = new icms_form_elements_Checkbox('', 'agree_disc', $agree_disc);
    $agree_chk->addOption(1, _US_IAGREE);
    $eltname = $agree_chk->getName();
    $eltmsg = str_replace('"', '\\"', stripslashes(sprintf(_FORM_ENTER, _US_IAGREE)));
    $agree_chk->customValidationCode[] = "if (myform.{$eltname}.checked == false) { window.alert(\"{$eltmsg}\"); myform.{$eltname}.focus(); return false; }";
    $disc_tray->addElement($agree_chk, true);
    $reg_form->addElement($disc_tray);
}
$reg_form->addElement(new icms_form_elements_Hidden("actkey", icms_core_DataFilter::htmlSpecialChars($actkey)));
if ($icmsConfigUser['use_captcha'] == true) {
    $reg_form->addElement(new icms_form_elements_Captcha(_SECURITYIMAGE_GETCODE, "scode"), true);
    $reg_form->addElement(new icms_form_elements_Hidden("op", "finish"));
Exemplo n.º 13
0
 * @since           1.2
 * @author          Jan Pedersen
 * @author          The SmartFactory <www.smartfactory.ca>
 * @author	   		Sina Asghari (aka stranger) <*****@*****.**>
 * @version         $Id: changepass.php 21139 2011-03-20 20:58:11Z m0nty_ $
 */
$profile_template = 'profile_changepass.html';
include 'header.php';
if (!icms::$user) {
    redirect_header(ICMS_URL, 2, _NOPERM);
}
if (!isset($_POST['submit'])) {
    //show change password form
    $form = new icms_form_Theme(_MD_PROFILE_CHANGEPASSWORD, 'form', $_SERVER['REQUEST_URI'], 'post', true);
    $form->addElement(new icms_form_elements_Password(_MD_PROFILE_OLDPASSWORD, 'oldpass', 10, 50), true);
    $pwd_tray = new icms_form_elements_Tray(_MD_PROFILE_NEWPASSWORD . '<br />' . _MD_PROFILE_VERIFYPASS);
    $pwd_tray->addElement(new icms_form_elements_Password('', 'password', 10, 255, '', false, $icmsConfigUser['pass_level'] ? 'password_adv' : ''));
    $pwd_tray->addElement(new icms_form_elements_Password('', 'vpass', 10, 255));
    $form->addElement($pwd_tray);
    $form->addElement(new icms_form_elements_Button('', 'submit', _SUBMIT, 'submit'));
    $form->assign($icmsTpl);
} else {
    $stop = '';
    $member_handler = icms::handler('icms_member');
    $username = icms::$user->getVar('uname');
    $password = !empty($_POST['password']) ? icms_core_DataFilter::stripSlashesGPC(trim($_POST['password'])) : '';
    $oldpass = !empty($_POST['oldpass']) ? icms_core_DataFilter::stripSlashesGPC(trim($_POST['oldpass'])) : '';
    $vpass = !empty($_POST['vpass']) ? icms_core_DataFilter::stripSlashesGPC(trim($_POST['vpass'])) : '';
    if (empty($password) || empty($oldpass) || empty($vpass)) {
        $stop .= _MD_PROFILE_PROVIDEPWDS;
    } else {
Exemplo n.º 14
0
/**
* Get {@link icms_form_Theme} for editing a user
*
* @param object $user {@link icms_member_user_Object} to edit
*
* @return object
*/
function getUserForm(&$user, $profile = false, $action = false)
{
    global $icmsConfig, $icmsConfigUser, $icmsConfigAuth;
    if ($action === false) {
        $action = $_SERVER['REQUEST_URI'];
    }
    $title = $user->isNew() ? _AM_PROFILE_ADDUSER : _MD_PROFILE_EDITPROFILE;
    icms_loadLanguageFile('core', 'user');
    $form = new icms_form_Theme($title, 'userinfo', $action, 'post', true);
    $profile_handler = icms_getModuleHandler('profile', basename(dirname(dirname(__FILE__))), 'profile');
    // Dynamic fields
    if (!$profile) {
        $profile_handler = icms_getModuleHandler('profile', basename(dirname(dirname(__FILE__))), 'profile');
        $profile = $profile_handler->get($user->getVar('uid'));
    }
    // Get fields
    $fields = $profile_handler->loadFields();
    // Get ids of fields that can be edited
    $gperm_handler = icms::handler('icms_member_groupperm');
    $editable_fields = $gperm_handler->getItemIds('profile_edit', icms::$user->getGroups(), icms::$module->getVar('mid'));
    $email_tray = new icms_form_elements_Tray(_MD_PROFILE_EMAIL, '<br />');
    if ($user->isNew() || icms::$user->isAdmin()) {
        $elements[0][] = array('element' => new icms_form_elements_Text(_US_LOGIN_NAME, 'login_name', 25, 75, $user->getVar('login_name', 'e')), 'required' => 1);
        $weights[0][] = 0;
        $elements[0][] = array('element' => new icms_form_elements_Text(_US_NICKNAME, 'uname', 25, 75, $user->getVar('uname', 'e')), 'required' => 1);
        $weights[0][] = 0;
        $elements[0][] = array('element' => new icms_form_elements_Text(_MD_PROFILE_EMAIL, 'email', 30, 60, $user->getVar('email')), 'required' => 1);
        $weights[0][] = 0;
    } else {
        $elements[0][] = array('element' => new icms_form_elements_Label(_US_LOGIN_NAME, $user->getVar('login_name', 'e')), 'required' => 0);
        $weights[0][] = 0;
        if ($icmsConfigUser['allow_chguname'] == 1) {
            $elements[0][] = array('element' => new icms_form_elements_Text(_US_NICKNAME, 'uname', 25, 75, $user->getVar('uname', 'e')), 'required' => 1);
        } else {
            $elements[0][] = array('element' => new icms_form_elements_Label(_US_NICKNAME, $user->getVar('uname')), 'required' => 0);
        }
        $weights[0][] = 0;
        $elements[0][] = array('element' => new icms_form_elements_Label(_MD_PROFILE_EMAIL, $user->getVar('email')), 'required' => 0);
        $weights[0][] = 0;
    }
    if ($icmsConfigAuth['auth_openid'] == 1) {
        $openid_tray = new icms_form_elements_Tray(_MD_PROFILE_OPENID, '<br />');
        $openid_tray->addElement(new icms_form_elements_Text('', 'openid', 30, 255, $user->getVar('openid')));
        $openid_checkbox = new icms_form_elements_Checkbox('', 'user_viewoid', $user->getVar('user_viewoid'));
        $openid_checkbox->addOption('1', _MD_PROFILE_OPENID_VIEW);
        $openid_tray->addElement($openid_checkbox);
        $elements[0][] = array('element' => $openid_tray, 'required' => 0);
        $weights[0][] = 0;
    }
    if (icms::$user->isAdmin() && $user->getVar('uid') != icms::$user->getVar('uid') or $user->getVar('uid') == icms::$user->getVar('uid')) {
        // ALTERED BY FREEFORM SOLUTIONS TO ALLOW USERS TO CHANGE THEIR OWN PASSWORDS
        //If the user is an admin and is editing someone else
        $pwd_text = new icms_form_elements_Password('', 'password', 10, 32, "", false, $icmsConfigUser['pass_level'] ? 'password_adv' : '');
        $pwd_text2 = new icms_form_elements_Password('', 'vpass', 10, 32);
        $pwd_tray = new icms_form_elements_Tray(_MD_PROFILE_PASSWORD . '<br />' . _MD_PROFILE_TYPEPASSTWICE);
        $pwd_tray->addElement($pwd_text, $user->isNew());
        $pwd_tray->addElement($pwd_text2, $user->isNew());
        $elements[0][] = array('element' => $pwd_tray, 'required' => 1);
        //cannot set an element tray required
        $weights[0][] = 0;
        if (icms::$user->isAdmin() && $user->getVar('uid') != icms::$user->getVar('uid')) {
            // ALTERED BY FREEFORM SOLUTIONS SO THAT USERS CAN'T ALTER THEIR OWN LEVEL
            $level_radio = new icms_form_elements_Radio(_MD_PROFILE_ACTIVEUSER, 'level', $user->getVar('level'));
            $level_radio->addOption(1, _MD_PROFILE_ACTIVE);
            $level_radio->addOption(0, _MD_PROFILE_INACTIVE);
            $level_radio->addOption(-1, _MD_PROFILE_DISABLED);
            $elements[0][] = array('element' => $level_radio, 'required' => 0);
            $weights[0][] = 0;
        }
    }
    $elements[0][] = array('element' => new icms_form_elements_Hidden('uid', $user->getVar('uid')), 'required' => 0);
    $weights[0][] = 0;
    $elements[0][] = array('element' => new icms_form_elements_Hidden('op', 'save'), 'required' => 0);
    $weights[0][] = 0;
    $profile_cat_handler = icms_getmodulehandler('category', basename(dirname(dirname(__FILE__))), 'profile');
    $categories = $profile_cat_handler->getObjects(null, true, false);
    foreach (array_keys($fields) as $i) {
        if (in_array($fields[$i]->getVar('fieldid'), $editable_fields)) {
            if ($fields[$i]->getVar('field_edit') == 1) {
                $fieldinfo['element'] = $fields[$i]->getEditElement($user, $profile);
                $fieldinfo['required'] = $fields[$i]->getVar('field_required');
                $key = $fields[$i]->getVar('catid');
                $elements[$key][] = $fieldinfo;
                $weights[$key][] = $fields[$i]->getVar('field_weight');
                // Image upload
                if ($fields[$i]->getVar('field_type') == "image") {
                    $form->setExtra('enctype="multipart/form-data"');
                }
            }
        }
    }
    if (icms::$user && icms::$user->isAdmin()) {
        icms_loadLanguageFile(basename(dirname(dirname(__FILE__))), 'admin');
        //If user has admin rights on groups
        include_once ICMS_ROOT_PATH . "/modules/system/constants.php";
        if ($gperm_handler->checkRight("system_admin", XOOPS_SYSTEM_GROUP, icms::$user->getGroups(), 1)) {
            //add group selection
            $group_select = new icms_form_elements_select_Group(_AM_PROFILE_GROUP, 'groups', false, $user->getGroups(), 15, true);
            // UPDATED BY FREEFORM SOLUTIONS - MAKE LIST TALLER
            $elements[0][] = array('element' => $group_select, 'required' => 0);
            $weights[0][] = 15000;
        }
    }
    ksort($elements);
    foreach (array_keys($elements) as $k) {
        array_multisort($weights[$k], SORT_ASC, array_keys($elements[$k]), SORT_ASC, $elements[$k]);
        $title = isset($categories[$k]) ? $categories[$k]['cat_title'] : _MD_PROFILE_DEFAULT;
        $desc = isset($categories[$k]) ? $categories[$k]['cat_description'] : "";
        $form->addElement(new icms_form_elements_Label($title, $desc), false);
        foreach (array_keys($elements[$k]) as $i) {
            $form->addElement($elements[$k][$i]['element'], $elements[$k][$i]['required']);
        }
    }
    $form->addElement(new icms_form_elements_Button('', 'submit', _MD_PROFILE_SAVECHANGES, 'submit'));
    return $form;
}
Exemplo n.º 15
0
     $form->addElement(new icms_form_elements_select_User(_AM_PROFILE_SELECTUSER, 'id'));
     $form->addElement(new icms_form_elements_Hidden('op', 'editordeleteormasquerade'));
     $button_tray = new icms_form_elements_Tray('');
     $button_tray->addElement(new icms_form_elements_Button('', 'edit', _EDIT, 'submit'));
     $button_tray->addElement(new icms_form_elements_Button('', 'delete', _DELETE, 'submit'));
     $button_tray->addElement(new icms_form_elements_Button('', 'masquerade', 'Masquerade', 'submit'));
     $form->addElement($button_tray);
     //$form->addElement(new icms_form_elements_Button('', 'submit', _SUBMIT, 'submit'));
     $form->display();
     echo "<br />\n";
     $user_count = $member_handler->getUserCount(new icms_db_criteria_Item('level', '-1'));
     if (count($user_count) > 1) {
         $form = new icms_form_Theme(_AM_PROFILE_REMOVEDUSERS, 'form', 'user.php');
         $form->addElement(new icms_form_elements_select_User(_AM_PROFILE_SELECTUSER, 'id', false, false, false, false, true, true));
         $form->addElement(new icms_form_elements_Hidden('op', 'editordeleteormasquerade'));
         $button_tray = new icms_form_elements_Tray('');
         $button_tray->addElement(new icms_form_elements_Button('', 'edit', _EDIT, 'submit'));
         $form->addElement($button_tray);
         $form->display();
         echo "<br />\n";
     }
 case 'new':
     icms_loadLanguageFile(basename(dirname(dirname(__FILE__))), 'main');
     if (!$adminMenuIncluded) {
         icms::$module->displayAdminMenu(0, _MI_PROFILE_USERS);
     }
     include_once '../include/forms.php';
     $obj = $member_handler->createUser();
     $obj->setGroups(array(ICMS_GROUP_USERS));
     $form =& getUserForm($obj, false, false, true);
     $form->display();
Exemplo n.º 16
0
 /**
  * Renders the form
  *
  * @return string
  * @access public
  */
 public function render()
 {
     // load all child ids for javascript codes
     foreach (array_keys($this->_itemTree) as $item_id) {
         $this->_itemTree[$item_id]['allchild'] = array();
         $this->_loadAllChildItemIds($item_id, $this->_itemTree[$item_id]['allchild']);
     }
     $gperm_handler = icms::handler('icms_member_groupperm');
     $member_handler = icms::handler('icms_member');
     $glist =& $member_handler->getGroupList();
     foreach (array_keys($glist) as $i) {
         // get selected item id(s) for each group
         $selected = $gperm_handler->getItemIds($this->_permName, $i, $this->_modid);
         $ele = new icms_form_elements_Groupperm($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
         $ele->setOptionTree($this->_itemTree);
         $this->addElement($ele);
         unset($ele);
     }
     $tray = new icms_form_elements_Tray('');
     $tray->addElement(new icms_form_elements_Button('', 'submit', _SUBMIT, 'submit'));
     $tray->addElement(new icms_form_elements_Button('', 'reset', _CANCEL, 'reset'));
     $this->addElement($tray);
     $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br />';
     $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1' valign='top'>\n";
     $elements = $this->getElements();
     $hidden = '';
     foreach (array_keys($elements) as $i) {
         if (!is_object($elements[$i])) {
             $ret .= $elements[$i];
         } elseif (!$elements[$i]->isHidden()) {
             $ret .= "<tr valign='top' align='" . _GLOBAL_LEFT . "'><td class='head'>" . $elements[$i]->getCaption();
             if ($elements[$i]->getDescription() != '') {
                 $ret .= '<br /><br /><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
             }
             $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
         } else {
             $hidden .= $elements[$i]->render();
         }
     }
     $ret .= "</table>{$hidden}</form>";
     $ret .= $this->renderValidationJS(true);
     return $ret;
 }
Exemplo n.º 17
0
         $rank_select->addOptionArray($ranks);
         $form->addElement($url_text);
         $form->addElement($location_text);
         $form->addElement($occupation_text);
         $form->addElement($interest_text);
         $form->addElement($mailok_radio);
         $form->addElement($avatar_radio);
         $form->addElement($level_radio);
         $form->addElement($group_select);
         $form->addElement($rank_select);
     } else {
         foreach (array("uname", "email") as $var) {
             $title = $items_match[$var];
             $text = new icms_form_elements_Text("", $var, 30, 100, @$_POST[$var]);
             $match = new icms_form_elements_select_Matchoption("", "{$var}_match", @$_POST["{$var}_match"]);
             $match_tray = new icms_form_elements_Tray($title, "&nbsp;");
             $match_tray->addElement($match);
             $match_tray->addElement($text);
             $form->addElement($match_tray);
             unset($text, $match, $match_tray);
         }
     }
     $sort_select = new icms_form_elements_Select(_MA_USER_SORT, "user_sort", @$_POST["user_sort"]);
     $sort_select->addOptionArray(array("uname" => _MA_USER_UNAME, "last_login" => _MA_USER_LASTLOGIN, "user_regdate" => _MA_USER_REGDATE, "posts" => _MA_USER_POSTS));
     $order_select = new icms_form_elements_Select(_MA_USER_ORDER, "user_order", @$_POST["user_order"]);
     $order_select->addOptionArray(array("ASC" => _MA_USER_ASC, "DESC" => _MA_USER_DESC));
     $form->addElement($sort_select);
     $form->addElement($order_select);
 }
 $form->addElement(new icms_form_elements_Text(_MA_USER_LIMIT, "limit", 6, 6, empty($_REQUEST["limit"]) ? 50 : (int) $_REQUEST["limit"]));
 $form->addElement(new icms_form_elements_Hidden("mode", $mode));
Exemplo n.º 18
0
}
if (!empty($display_criteria)) {
    $selected_groups = array();
    $group_select = new icms_form_elements_select_Group(_AM_GROUPIS . "<br />", "mail_to_group", FALSE, $selected_groups, 5, TRUE);
    $lastlog_min = new icms_form_elements_Text(_AM_LASTLOGMIN . "<br />" . _AM_TIMEFORMAT . "<br />", "mail_lastlog_min", 20, 10);
    $lastlog_max = new icms_form_elements_Text(_AM_LASTLOGMAX . "<br />" . _AM_TIMEFORMAT . "<br />", "mail_lastlog_max", 20, 10);
    $regd_min = new icms_form_elements_Text(_AM_REGDMIN . "<br />" . _AM_TIMEFORMAT . "<br />", "mail_regd_min", 20, 10);
    $regd_max = new icms_form_elements_Text(_AM_REGDMAX . "<br />" . _AM_TIMEFORMAT . "<br />", "mail_regd_max", 20, 10);
    $idle_more = new icms_form_elements_Text(_AM_IDLEMORE . "<br />", "mail_idle_more", 10, 5);
    $idle_less = new icms_form_elements_Text(_AM_IDLELESS . "<br />", "mail_idle_less", 10, 5);
    $mailok_cbox = new icms_form_elements_Checkbox('', 'mail_mailok');
    $mailok_cbox->addOption(1, _AM_MAILOK);
    $inactive_cbox = new icms_form_elements_Checkbox('', 'mail_inactive');
    $inactive_cbox->addOption(1, _AM_INACTIVE . '. ' . _AMIFCHECKD);
    $inactive_cbox->setExtra("onclick='javascript:disableElement(\"mail_lastlog_min\");disableElement(\"mail_lastlog_max\");disableElement(\"mail_idle_more\");disableElement(\"mail_idle_less\");disableElement(\"mail_to_group[]\");'");
    $criteria_tray = new icms_form_elements_Tray(_AM_SENDTOUSERS, "<br /><br />");
    $criteria_tray->addElement($group_select);
    $criteria_tray->addElement($lastlog_min);
    $criteria_tray->addElement($lastlog_max);
    $criteria_tray->addElement($idle_more);
    $criteria_tray->addElement($idle_less);
    $criteria_tray->addElement($mailok_cbox);
    $criteria_tray->addElement($inactive_cbox);
    $criteria_tray->addElement($regd_min);
    $criteria_tray->addElement($regd_max);
    $form->addElement($criteria_tray);
}
$fname_text = new icms_form_elements_Text(_AM_MAILFNAME, "mail_fromname", 30, 255, htmlspecialchars($icmsConfig['sitename'], ENT_QUOTES));
$fromemail = !empty($icmsConfig['adminmail']) ? $icmsConfig['adminmail'] : icms::$user->getVar("email", "E");
$femail_text = new icms_form_elements_Text(_AM_MAILFMAIL, "mail_fromemail", 30, 255, $fromemail);
//$subject_caption = _AM_MAILSUBJECT . "<br /><br /><span style='font-size:x-small;font-weight:bold;'>" . _AM_MAILTAGS . "</span><br /><span style='font-size:x-small;font-weight:normal;'>" . _AM_MAILTAGS1 . "<br />" . _AM_MAILTAGS2 . "<br />" . _AM_MAILTAGS3 . "</span>";
Exemplo n.º 19
0
//  $avatar_tray = new icms_form_elements_Tray(_AM_AVATAR, "&nbsp;");
//  $avatar_tray->addElement($avatar_select);
//  $avatar_tray->addElement($avatar_label);
//  foreach ($a_dir_labels as $a_dir_label) {
//	  $avatar_tray->addElement($a_dir_label);
//  }
//  $theme_select = new icms_form_elements_select_Theme(_AM_THEME, "theme", $theme_value);
$timezone_select = new icms_form_elements_select_Timezone(_US_TIMEZONE, "timezone_offset", $timezone_value);
$icq_text = new icms_form_elements_Text(_AM_ICQ, "user_icq", 15, 15, $icq_value);
$aim_text = new icms_form_elements_Text(_AM_AIM, "user_aim", 18, 18, $aim_value);
$yim_text = new icms_form_elements_Text(_AM_YIM, "user_yim", 25, 25, $yim_value);
$msnm_text = new icms_form_elements_Text(_AM_MSNM, "user_msnm", 30, 100, $msnm_value);
$location_text = new icms_form_elements_Text(_AM_LOCATION, "user_from", 30, 100, $location_value);
$occupation_text = new icms_form_elements_Text(_AM_OCCUPATION, "user_occ", 30, 100, $occ_value);
$interest_text = new icms_form_elements_Text(_AM_INTEREST, "user_intrest", 30, 150, $interest_value);
$sig_tray = new icms_form_elements_Tray(_AM_SIGNATURE, "<br />");
if ($icmsConfigUser['allow_htsig'] == 0) {
    $sig_tarea = new icms_form_elements_Textarea("", "user_sig", $sig_value);
} else {
    $sig_tarea = new icms_form_elements_Dhtmltextarea("", "user_sig", $sig_value);
}
$sig_tray->addElement($sig_tarea);
$sig_cbox = new icms_form_elements_Checkbox("", "attachsig", $sig_cbox_value);
$sig_cbox->addOption(1, _US_SHOWSIG);
$sig_tray->addElement($sig_cbox);
$umode_select = new icms_form_elements_Select(_US_CDISPLAYMODE, "umode", $umode_value);
$umode_select->addOptionArray(array("nest" => _NESTED, "flat" => _FLAT, "thread" => _THREADED));
$uorder_select = new icms_form_elements_Select(_US_CSORTORDER, "uorder", $uorder_value);
$uorder_select->addOptionArray(array("0" => _OLDESTFIRST, "1" => _NEWESTFIRST));
// RMV-NOTIFY
icms_loadLanguageFile('core', 'notification');
Exemplo n.º 20
0
<?php

/**
 * Administration of smilies, form file
 *
 * @copyright	http://www.impresscms.org/ The ImpressCMS Project
 * @license		LICENSE.txt
 * @package		System
 * @subpackage	Smilies
 * @version		SVN: $Id: smileform.php 20851 2011-02-18 05:18:10Z skenow $
 */
$smile_form = new icms_form_Theme($smiles['smile_form'], 'smileform', 'admin.php', 'post', TRUE);
$smile_form->setExtra('enctype="multipart/form-data"');
$smile_form->addElement(new icms_form_elements_Text(_AM_SMILECODE, 'smile_code', 26, 25, $smiles['smile_code']), TRUE);
$smile_form->addElement(new icms_form_elements_Text(_AM_SMILEEMOTION, 'smile_desc', 26, 25, $smiles['smile_desc']), TRUE);
$smile_select = new icms_form_elements_File('', 'smile_url', 5000000);
$smile_label = new icms_form_elements_Label('', '<img src="' . ICMS_UPLOAD_URL . '/' . $smiles['smile_url'] . '" alt="" />');
$smile_tray = new icms_form_elements_Tray(_IMAGEFILE . '&nbsp;');
$smile_tray->addElement($smile_select);
$smile_tray->addElement($smile_label);
$smile_form->addElement($smile_tray);
$smile_form->addElement(new icms_form_elements_Radioyn(_AM_DISPLAYF, 'smile_display', $smiles['smile_display']));
$smile_form->addElement(new icms_form_elements_Hidden('id', $smiles['id']));
$smile_form->addElement(new icms_form_elements_Hidden('op', $smiles['op']));
$smile_form->addElement(new icms_form_elements_Hidden('fct', 'smilies'));
$smile_form->addElement(new icms_form_elements_Button('', 'submit', _SUBMIT, 'submit'));
Exemplo n.º 21
0
 /**
  * generate merge form
  *
  * @return icms_form_Theme merge form
  */
 public function getMergeForm()
 {
     $form = new icms_form_Theme(_AM_PROFILE_TRIBES_MERGE_DSC, 'mergetribes', '');
     $form->addElement(new icms_form_elements_Label(_AM_PROFILE_TRIBE, $this->getVar('title')));
     $tribes_select = new icms_form_elements_Select(_AM_PROFILE_TRIBES_MERGEWITH, 'merge_tribes_id');
     $tribes_select->addOptionArray($this->handler->getList(new icms_db_criteria_Compo(new icms_db_criteria_Item('tribes_id', $this->getVar('tribes_id'), '<>'))));
     $form->addElement($tribes_select);
     $form->addElement(new icms_form_elements_Label(_AM_PROFILE_TRIBES_MERGE_WARNING, sprintf(_AM_PROFILE_TRIBES_MERGE_WARNING_DSC, $this->getVar('title'))));
     $button_tray = new icms_form_elements_Tray('', '');
     $button_tray->addElement(new icms_form_elements_Button('', 'modify_button', _AM_PROFILE_TRIBES_MERGE, 'submit'));
     $butt_cancel = new icms_form_elements_Button('', 'cancel_button', _CO_ICMS_CANCEL, 'button');
     $butt_cancel->setExtra('onclick="history.go(-1)"');
     $button_tray->addElement($butt_cancel);
     $form->addElement($button_tray);
     $form->addElement(new icms_form_elements_Hidden('tribes_id', $this->getVar('tribes_id')));
     $form->addElement(new icms_form_elements_Hidden('op', 'mergefinal'));
     return $form;
 }
Exemplo n.º 22
0
foreach ($subject_icons as $iconfile) {
    $icons_radio->addOption($iconfile, '<img src="' . ICMS_IMAGES_URL . '/subject/' . $iconfile . '" alt="" />');
}
$cform->addElement($icons_radio);
$cform->addElement(new icms_form_elements_Dhtmltextarea(_CM_MESSAGE, 'message', $message, 10, 50), true);
$option_tray = new icms_form_elements_Tray(_OPTIONS, '<br />');
if (icms::$user) {
    if ($icmsConfig['anonpost'] == true) {
        $noname_checkbox = new icms_form_elements_Checkbox('', 'noname', $noname);
        $noname_checkbox->addOption(1, _POSTANON);
        $option_tray->addElement($noname_checkbox);
    }
    if (icms::$user->isAdmin($icmsModule->getVar('mid'))) {
        $nohtml_checkbox = new icms_form_elements_Checkbox('', 'nohtml', $nohtml);
        $nohtml_checkbox->addOption(1, _DISABLEHTML);
        $option_tray->addElement($nohtml_checkbox);
    }
}
$smiley_checkbox = new icms_form_elements_Checkbox('', 'nosmiley', $nosmiley);
$smiley_checkbox->addOption(1, _DISABLESMILEY);
$option_tray->addElement($smiley_checkbox);
$cform->addElement($option_tray);
$cform->addElement(new icms_form_elements_Hidden('pid', (int) $pid));
$cform->addElement(new icms_form_elements_Hidden('comment_id', (int) $comment_id));
$cform->addElement(new icms_form_elements_Hidden('item_id', (int) $item_id));
$cform->addElement(new icms_form_elements_Hidden('order', (int) $order));
$button_tray = new icms_form_elements_Tray('', '&nbsp;');
$button_tray->addElement(new icms_form_elements_Button('', 'preview', _PREVIEW, 'submit'));
$button_tray->addElement(new icms_form_elements_Button('', 'post', _CM_POSTCOMMENT, 'submit'));
$cform->addElement($button_tray);
$cform->display();
Exemplo n.º 23
0
 * @subpackage	Template Sets
 * @version		SVN: $Id: tplform.php 20852 2011-02-18 05:19:56Z skenow $
 */
if ($tform['tpl_tplset'] != 'default') {
    $form = new icms_form_Theme(_MD_EDITTEMPLATE, 'template_form', 'admin.php', 'post', TRUE);
} else {
    $form = new icms_form_Theme(_MD_VIEWTEMPLATE, 'template_form', 'admin.php', 'post', TRUE);
}
$form->addElement(new icms_form_elements_Label(_MD_FILENAME, $tform['tpl_file']));
$form->addElement(new icms_form_elements_Label(_MD_FILEDESC, $tform['tpl_desc']));
$form->addElement(new icms_form_elements_Label(_MD_LASTMOD, formatTimestamp($tform['tpl_lastmodified'], 'l')));
$config = array('name' => 'html', 'value' => $tform['tpl_source'], 'language' => _LANGCODE, 'width' => '100%', 'height' => '400px', 'syntax' => 'html');
if ($tform['tpl_tplset'] == 'default') {
    $config["is_editable"] = FALSE;
}
$tpl_src = icms_plugins_EditorHandler::getInstance('source')->get($icmsConfig['sourceeditor_default'], $config);
$tpl_src->setCaption(_MD_FILEHTML);
$form->addElement($tpl_src);
$form->addElement(new icms_form_elements_Hidden('id', $tform['tpl_id']));
$form->addElement(new icms_form_elements_Hidden('op', 'edittpl_go'));
$form->addElement(new icms_form_elements_Hidden('redirect', 'edittpl'));
$form->addElement(new icms_form_elements_Hidden('fct', 'tplsets'));
$form->addElement(new icms_form_elements_Hidden('moddir', $tform['tpl_module']));
if ($tform['tpl_tplset'] != 'default') {
    $button_tray = new icms_form_elements_Tray('');
    $button_tray->addElement(new icms_form_elements_Button('', 'previewtpl', _PREVIEW, 'submit'));
    $button_tray->addElement(new icms_form_elements_Button('', 'submittpl', _SUBMIT, 'submit'));
    $form->addElement($button_tray);
} else {
    $form->addElement(new icms_form_elements_Button('', 'previewtpl', _MD_VIEW, 'submit'));
}
Exemplo n.º 24
0
    $new_blocks_array = array();
    $blocks_array = $icms_block_handler->getAllBlocks("list", $k);
    /* compare to list of blocks the group can read, do not filter for administrator group */
    if (!in_array(XOOPS_GROUP_ADMIN, $groups)) {
        $r_blocks = $gperm->getItemIds('block_read', $groups);
        $n_blocks_array = array_intersect_key($blocks_array, array_flip($r_blocks));
    } else {
        $n_blocks_array = $blocks_array;
    }
    foreach ($n_blocks_array as $key => $value) {
        $new_blocks_array[$key] = "<a href='" . ICMS_MODULES_URL . "/system/admin.php?fct=blocksadmin&amp;op=mod&amp;bid=" . $key . "'>" . $value . " (ID: " . $key . ")</a>";
    }
    $block_checkbox[$i]->addOptionArray($new_blocks_array);
    $i++;
}
$r_block_tray = new icms_form_elements_Tray(_AM_BLOCKRIGHTS, "<br /><br />");
foreach ($block_checkbox as $k => $v) {
    $r_block_tray->addElement($block_checkbox[$k]);
}
$op_hidden = new icms_form_elements_Hidden("op", $op_value);
$fct_hidden = new icms_form_elements_Hidden("fct", "groups");
$submit_button = new icms_form_elements_Button("", "groupsubmit", $submit_value, "submit");
$form = new icms_form_Theme($form_title, "groupform", "admin.php", "post", true);
$form->addElement($name_text);
$form->addElement($desc_text);
$form->addElement($s_cat_checkbox);
if (!isset($g_id) || $g_id != XOOPS_GROUP_ADMIN && $g_id != XOOPS_GROUP_ANONYMOUS) {
    $form->addElement($group_manager_checkbox);
}
$form->addElement($a_mod_checkbox);
$form->addElement($r_mod_checkbox);
Exemplo n.º 25
0
/**
 * Adding an image for the Image manager
 *
 * @return	string    The constructed HTML form for the adding of an image
 */
function showAddImgForm($imgcat_id) {
	global $target, $type;
	$imgcat_handler = icms::handler('icms_image_category');
	$form = new icms_form_Theme(_ADDIMAGE, 'image_form', $_SERVER['SCRIPT_NAME'], 'post', TRUE);
	$form->setExtra('enctype="multipart/form-data"');
	$form->addElement(new icms_form_elements_Text(_IMAGENAME, 'image_nicename', 50, 255), TRUE);
	$select = new icms_form_elements_Select(_IMAGECAT, 'imgcat_id', (int) $imgcat_id);
	$select->addOptionArray($imgcat_handler->getCategList());
	$form->addElement($select, TRUE);
	$form->addElement(new icms_form_elements_File(_IMAGEFILE, 'image_file', 5000000));
	$form->addElement(new icms_form_elements_Text(_IMGWEIGHT, 'image_weight', 3, 4, 0));
	$form->addElement(new icms_form_elements_Radioyn(_IMGDISPLAY, 'image_display', 1, _YES, _NO));
	$form->addElement(new icms_form_elements_Hidden('imgcat_id', $imgcat_id));
	$form->addElement(new icms_form_elements_Hidden('op', 'addfile'));
	$form->addElement(new icms_form_elements_Hidden('target', $target));
	$form->addElement(new icms_form_elements_Hidden('type', $type));
	$tray = new icms_form_elements_Tray('' , '');
	$tray->addElement(new icms_form_elements_Button('', 'img_button', _SUBMIT, 'submit'));
	$btn = new icms_form_elements_Button('', 'reset', _CANCEL, 'button');
	$btn->setExtra('onclick="document.getElementById(\'addimgform\').style.display = \'none\'; return FALSE;"');
	$tray->addElement($btn);
	$form->addElement($tray);
	return $form->render();
}
Exemplo n.º 26
0
						
				case 'user' :
					$ele = new icms_form_elements_select_User($title, $config[$i]->getVar('conf_name'), FALSE, $config[$i]->getConfValueForOutput(), 1, FALSE);
					break;
						
				case 'user_multi' :
					$ele = new icms_form_elements_select_User($title, $config[$i]->getVar('conf_name'), FALSE, $config[$i]->getConfValueForOutput(), 5, TRUE);
					break;
						
				case 'module_cache' :
					$module_handler = icms::handler('icms_module');
					$modules = $module_handler->getObjects(new icms_db_criteria_Item('hasmain', 1), TRUE);
					$currrent_val = $config[$i]->getConfValueForOutput();
					$cache_options = array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK);
					if (count($modules) > 0) {
						$ele = new icms_form_elements_Tray($title, '<br />');
						foreach (array_keys($modules) as $mid) {
							$c_val = isset($currrent_val[$mid]) ?(int) $currrent_val[$mid] : NULL;
							$selform = new icms_form_elements_Select($modules[$mid]->getVar('name'), $config[$i]->getVar('conf_name') . "[$mid]", $c_val);
							$selform->addOptionArray($cache_options);
							$ele->addElement($selform);
							unset($selform);
						}
					} else {
						$ele = new icms_form_elements_Label($title, _MD_AM_NOMODULE);
					}
					break;
						
				case 'site_cache' :
					$ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
					$ele->addOptionArray(array('0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), '60' => _MINUTE, '300' => sprintf(_MINUTES, 5), '1800' => sprintf(_MINUTES, 30), '3600' => _HOUR, '18000' => sprintf(_HOURS, 5), '86400' => _DAY, '259200' => sprintf(_DAYS, 3), '604800' => _WEEK));
Exemplo n.º 27
0
        default:
            $rule_text = _CM_COMAPPROVEADMIN;
            break;
    }
    $cform->addElement(new icms_form_elements_Label(_CM_COMRULES, $rule_text));
}
$cform->addElement(new icms_form_elements_Text(_CM_TITLE, 'com_title', 50, 255, $com_title), TRUE);
$icons_radio = new icms_form_elements_Radio(_MESSAGEICON, 'com_icon', $com_icon);
$subject_icons = icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . "/images/subject/", '', array('gif', 'jpg', 'png'));
foreach ($subject_icons as $iconfile) {
    $icons_radio->addOption($iconfile, '<img src="' . ICMS_URL . '/images/subject/' . $iconfile . '" alt="" />');
}
$cform->addElement($icons_radio);
$cform->addElement(new icms_form_elements_Dhtmltextarea(_CM_MESSAGE, 'com_text', $com_text, 10, 50), TRUE);
$option_tray = new icms_form_elements_Tray(_OPTIONS, '<br />');
$button_tray = new icms_form_elements_Tray('', '&nbsp;');
if (is_object(icms::$user)) {
    if ($icmsModuleConfig['com_anonpost'] == 1) {
        $noname = !empty($noname) ? 1 : 0;
        $noname_checkbox = new icms_form_elements_Checkbox('', 'noname', $noname);
        $noname_checkbox->addOption(1, _POSTANON);
        $option_tray->addElement($noname_checkbox);
    }
    if (FALSE != icms::$user->isAdmin($com_modid)) {
        // show status change box when editing (comment id is not empty)
        if (!empty($com_id)) {
            include_once ICMS_ROOT_PATH . '/include/comment_constants.php';
            $status_select = new icms_form_elements_Select(_CM_STATUS, 'com_status', $com_status);
            $status_select->addOptionArray(array(XOOPS_COMMENT_PENDING => _CM_PENDING, XOOPS_COMMENT_ACTIVE => _CM_ACTIVE, XOOPS_COMMENT_HIDDEN => _CM_HIDDEN));
            $cform->addElement($status_select);
            $button_tray->addElement(new icms_form_elements_Button('', 'com_dodelete', _DELETE, 'submit'));
Exemplo n.º 28
0
/**
 * Displays user information form
 * 
 */
function displayUsers() {
	global $icmsConfig, $icmsModule, $icmsConfigUser;
	$userstart = isset($_GET['userstart']) ? (int) $_GET['userstart'] : 0;

	icms_cp_header();
	echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/users/images/users_big.png)">' . _MD_AM_USER . '</div><br />';
	$member_handler = icms::handler('icms_member');
	$usercount = $member_handler->getUserCount(new icms_db_criteria_Item('level', '-1', '!='));
	$nav = new icms_view_PageNav($usercount, 200, $userstart, 'userstart', 'fct=users');
	$editform = new icms_form_Theme(_AM_EDEUSER, 'edituser', 'admin.php');
	$user_select = new icms_form_elements_Select('', 'uid');
	$criteria = new icms_db_criteria_Compo();
	$criteria->add(new icms_db_criteria_Item('level', '-1', '!='));
	$criteria->setSort('uname');
	$criteria->setOrder('ASC');
	$criteria->setLimit(200);
	$criteria->setStart($userstart);
	$user_select->addOptionArray($member_handler->getUserList($criteria));
	$user_select_tray = new icms_form_elements_Tray(_AM_NICKNAME, '<br />');
	$user_select_tray->addElement($user_select);
	$user_select_nav = new icms_form_elements_Label('', $nav->renderNav(4));
	$user_select_tray->addElement($user_select_nav);
	
	$op_select = new icms_form_elements_Select('', 'op');
	$op_select->addOptionArray(array('modifyUser'=>_AM_MODIFYUSER, 'delUser'=>_AM_DELUSER));
	
	$submit_button = new icms_form_elements_Button('', 'submit', _AM_GO, 'submit');
	$fct_hidden = new icms_form_elements_Hidden('fct', 'users');
	$editform->addElement($user_select_tray);
	$editform->addElement($op_select);
	$editform->addElement($submit_button);
	$editform->addElement($fct_hidden);
	$editform->display();

	echo "<br />\n";
	$usercount = $member_handler->getUserCount(new icms_db_criteria_Item('level', '-1'));
	$nav = new icms_view_PageNav($usercount, 200, $userstart, 'userstart', 'fct=users');
	$editform = new icms_form_Theme(_AM_REMOVED_USERS, 'edituser', 'admin.php');
	$user_select = new icms_form_elements_Select('', 'uid');
	$criteria = new icms_db_criteria_Compo();
	$criteria->add(new icms_db_criteria_Item('level', '-1'));
	$criteria->setSort('uname');
	$criteria->setOrder('ASC');
	$criteria->setLimit(200);
	$criteria->setStart($userstart);
	$user_select->addOptionArray($member_handler->getUserList($criteria));
	$user_select_tray = new icms_form_elements_Tray(_AM_NICKNAME, '<br />');
	$user_select_tray->addElement($user_select);
	$user_select_nav = new icms_form_elements_Label('', $nav->renderNav(4));
	$user_select_tray->addElement($user_select_nav);

	$op_select = new icms_form_elements_Select('', 'op');
	$op_select->addOptionArray(array('modifyUser'=>_AM_MODIFYUSER));

	$submit_button = new icms_form_elements_Button('', 'submit', _AM_GO, 'submit');
	$fct_hidden = new icms_form_elements_Hidden('fct', 'users');
	$editform->addElement($user_select_tray);
	$editform->addElement($op_select);
	$editform->addElement($submit_button);
	$editform->addElement($fct_hidden);
	$editform->display();

	echo "<br />\n";
	$uid_value = '';
	$uname_value = '';
	$login_name_value = '';
	$name_value = '';
	$email_value = '';
	$email_cbox_value = 0;
	$openid_value = '';
	$openid_cbox_value = 0;
	$url_value = '';
	$timezone_value = $icmsConfig['default_TZ'];
	$icq_value = '';
	$aim_value = '';
	$yim_value = '';
	$msnm_value = '';
	$location_value = '';
	$occ_value = '';
	$interest_value = '';
	$sig_value = '';
	$sig_cbox_value = 0;
	$umode_value = $icmsConfig['com_mode'];
	$uorder_value = $icmsConfig['com_order'];

	include_once ICMS_INCLUDE_PATH .'/notification_constants.php';
	$notify_method_value = XOOPS_NOTIFICATION_METHOD_PM;
	$notify_mode_value = XOOPS_NOTIFICATION_MODE_SENDALWAYS;
	$bio_value = '';
	$rank_value = 0;
	$mailok_value = 0;
	$pass_expired_value = 0;
	$op_value = 'addUser';
	$form_title = _AM_ADDUSER;
	$form_isedit = FALSE;
	$language_value = $icmsConfig['language'];
	$groups = array(XOOPS_GROUP_USERS);
	include ICMS_MODULES_PATH . '/system/admin/users/userform.php';
	icms_cp_footer();
}
Exemplo n.º 29
0
     if ($icmsConfigUser['avatar_allow_upload'] == 1 && icms::$user->getVar('posts') >= $icmsConfigUser['avatar_minposts']) {
         $form = new icms_form_Theme(_MD_PROFILE_UPLOADMYAVATAR, 'uploadavatar', ICMS_URL . '/modules/' . basename(dirname(__FILE__)) . '/edituser.php', 'post', true);
         $form->setExtra('enctype="multipart/form-data"');
         $form->addElement(new icms_form_elements_Label(_MD_PROFILE_MAXPIXEL, $icmsConfigUser['avatar_width'] . ' x ' . $icmsConfigUser['avatar_height']));
         $form->addElement(new icms_form_elements_Label(_MD_PROFILE_MAXIMGSZ, $icmsConfigUser['avatar_maxsize']));
         $form->addElement(new icms_form_elements_File(_MD_PROFILE_SELFILE, 'avatarfile', $icmsConfigUser['avatar_maxsize']), true);
         $form->addElement(new icms_form_elements_Hidden('op', 'avatarupload'));
         $form->addElement(new icms_form_elements_Hidden('uid', icms::$user->getVar('uid')));
         $form->addElement(new icms_form_elements_Button('', 'submit', _SUBMIT, 'submit'));
         $form->display();
     }
     $form2 = new icms_form_Theme(_MD_PROFILE_CHOOSEAVT, 'uploadavatar', ICMS_URL . '/modules/' . basename(dirname(__FILE__)) . '/edituser.php', 'post', true);
     $avatar_select = new icms_form_elements_Select('', 'user_avatar', icms::$user->getVar('user_avatar'));
     $avatar_select->addOptionArray(icms::handler('icms_data_avatar')->getList('S'));
     $avatar_select->setExtra("onchange='showImgSelected(\"avatar\", \"user_avatar\", \"uploads\", \"\", \"" . ICMS_URL . "\")'");
     $avatar_tray = new icms_form_elements_Tray(_MD_PROFILE_AVATAR, '&nbsp;');
     $avatar_tray->addElement($avatar_select);
     $avatar_tray->addElement(new icms_form_elements_Label('', "<img src='" . ICMS_UPLOAD_URL . "/" . icms::$user->getVar("user_avatar", "E") . "' name='avatar' id='avatar' alt='' /> <a href=\"javascript:openWithSelfMain('" . ICMS_URL . "/misc.php?action=showpopups&amp;type=avatars','avatars',600,400);\">" . _LIST . "</a>"));
     $form2->addElement($avatar_tray);
     $form2->addElement(new icms_form_elements_Hidden('uid', icms::$user->getVar('uid')));
     $form2->addElement(new icms_form_elements_Hidden('op', 'avatarchoose'));
     $form2->addElement(new icms_form_elements_Button('', 'submit2', _SUBMIT, 'submit'));
     $form2->display();
     break;
 case 'avatarupload':
     if (!icms::$security->check()) {
         redirect_header('index.php', 3, _MD_PROFILE_NOEDITRIGHT . "<br />" . implode('<br />', icms::$security->getErrors()));
         exit;
     }
     $uid = 0;
     if (!empty($_POST['uid'])) {
Exemplo n.º 30
0
 /**
  * Add an element to the form
  *
  * @param	string  $form_name              name of the form
  * @param	string  $form_caption           caption of the form
  * @param	string  $submit_button_caption  caption of the button
  */
 private function createButtons($form_name, $form_caption, $submit_button_caption = FALSE)
 {
     $button_tray = new icms_form_elements_Tray('', '');
     $button_tray->addElement(new icms_form_elements_Hidden('op', $form_name));
     if (!$submit_button_caption) {
         if ($this->targetObject->isNew()) {
             $butt_create = new icms_form_elements_Button('', 'create_button', _CO_ICMS_CREATE, 'submit');
         } else {
             $butt_create = new icms_form_elements_Button('', 'modify_button', _CO_ICMS_MODIFY, 'submit');
         }
     } else {
         $butt_create = new icms_form_elements_Button('', 'modify_button', $submit_button_caption, 'submit');
     }
     $butt_create->setExtra('onclick="this.form.elements.op.value=\'' . $form_name . '\'"');
     $button_tray->addElement($butt_create);
     //creating custom buttons
     if ($this->_custom_button) {
         foreach ($this->_custom_button as $custom_button) {
             $butt_custom = new icms_form_elements_Button('', $custom_button['name'], $custom_button['caption'], 'submit');
             if ($custom_button['onclick']) {
                 $butt_custom->setExtra('onclick="' . $custom_button['onclick'] . '"');
             }
             $button_tray->addElement($butt_custom);
             unset($butt_custom);
         }
     }
     // creating the "cancel" button
     $butt_cancel = new icms_form_elements_Button('', 'cancel_button', _CO_ICMS_CANCEL, 'button');
     if ($this->_cancel_js_action) {
         $butt_cancel->setExtra('onclick="' . $this->_cancel_js_action . '"');
     } else {
         $butt_cancel->setExtra('onclick="history.go(-1)"');
     }
     $button_tray->addElement($butt_cancel);
     $this->addElement($button_tray);
 }