当前位置: 首页>>代码示例>>PHP>>正文


PHP TextField::setInvitation方法代码示例

本文整理汇总了PHP中TextField::setInvitation方法的典型用法代码示例。如果您正苦于以下问题:PHP TextField::setInvitation方法的具体用法?PHP TextField::setInvitation怎么用?PHP TextField::setInvitation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextField的用法示例。


在下文中一共展示了TextField::setInvitation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     parent::__construct('add-album');
     $this->setAjax();
     $this->setAjaxResetOnSuccess(FALSE);
     $this->setAction(OW::getRouter()->urlFor('PHOTO_CTRL_Photo', 'ajaxResponder'));
     $ajaxFunc = new HiddenField('ajaxFunc');
     $ajaxFunc->setValue('ajaxMoveToAlbum');
     $ajaxFunc->setRequired();
     $this->addElement($ajaxFunc);
     $fromAlbum = new HiddenField('from-album');
     $fromAlbum->setRequired();
     $fromAlbum->addValidator(new PHOTO_CLASS_AlbumOwnerValidator());
     $this->addElement($fromAlbum);
     $toAlbum = new HiddenField('to-album');
     $this->addElement($toAlbum);
     $photos = new HiddenField('photos');
     $photos->setRequired();
     $this->albumPhotosValidator = new AlbumPhotosValidator();
     $photos->addValidator($this->albumPhotosValidator);
     $this->addElement($photos);
     $albumName = new TextField('album-name');
     $albumName->setRequired();
     $albumName->addValidator(new PHOTO_CLASS_AlbumNameValidator(FALSE));
     $albumName->setHasInvitation(TRUE);
     $albumName->setInvitation(OW::getLanguage()->text('photo', 'album_name'));
     $albumName->addAttribute('class', 'ow_smallmargin');
     $this->addElement($albumName);
     $desc = new Textarea('desc');
     $desc->setHasInvitation(TRUE);
     $desc->setInvitation(OW::getLanguage()->text('photo', 'album_desc'));
     $this->addElement($desc);
     $this->addElement(new Submit('add'));
 }
开发者ID:tammyrocks,项目名称:photo,代码行数:34,代码来源:album_add_form.php

示例2: __construct

 public function __construct()
 {
     parent::__construct('upload-form');
     $language = OW::getLanguage();
     $this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
     $fileField = new FileField('photo');
     //$fileField->setRequired(true);
     $this->addElement($fileField);
     // album Field
     $albumField = new TextField('album');
     $albumField->setRequired(true);
     $albumField->setHasInvitation(true);
     $albumField->setId('album_input');
     $albumField->setInvitation($language->text('photo', 'create_album'));
     $this->addElement($albumField);
     // description Field
     $descField = new Textarea('description');
     $descField->setHasInvitation(true);
     $descField->setInvitation($language->text('photo', 'describe_photo'));
     $this->addElement($descField);
     $cancel = new Submit('cancel', false);
     $cancel->setValue($language->text('base', 'cancel_button'));
     $this->addElement($cancel);
     $submit = new Submit('submit', false);
     $this->addElement($submit);
 }
开发者ID:tammyrocks,项目名称:photo,代码行数:26,代码来源:upload_form.php

示例3: __construct

 /**
  * Constructor.
  */
 public function __construct($ajax = false)
 {
     parent::__construct();
     $form = new Form('sign-in');
     $form->setAction("");
     $username = new TextField('identity');
     $username->setRequired(true);
     $username->setHasInvitation(true);
     $username->setInvitation(OW::getLanguage()->text('base', 'component_sign_in_login_invitation'));
     $form->addElement($username);
     $password = new PasswordField('password');
     $password->setHasInvitation(true);
     $password->setInvitation('password');
     $password->setRequired(true);
     $form->addElement($password);
     $remeberMe = new CheckboxField('remember');
     $remeberMe->setValue(true);
     $remeberMe->setLabel(OW::getLanguage()->text('base', 'sign_in_remember_me_label'));
     $form->addElement($remeberMe);
     $submit = new Submit('submit');
     $submit->setValue(OW::getLanguage()->text('base', 'sign_in_submit_label'));
     $form->addElement($submit);
     $this->addForm($form);
     if ($ajax) {
         $form->setAjaxResetOnSuccess(false);
         $form->setAjax();
         $form->setAction(OW::getRouter()->urlFor('BASE_CTRL_User', 'ajaxSignIn'));
         $form->bindJsFunction(Form::BIND_SUCCESS, 'function(data){if( data.result ){if(data.message){OW.info(data.message);}setTimeout(function(){window.location.reload();}, 1000);}else{OW.error(data.message);}}');
         $this->assign('forgot_url', OW::getRouter()->urlForRoute('base_forgot_password'));
     }
     $this->assign('joinUrl', OW::getRouter()->urlForRoute('base_join'));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:35,代码来源:sign_in.php

示例4: __construct

 public function __construct($opponentId)
 {
     parent::__construct('composeMessageForm');
     $this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
     $field = new HiddenField('uid');
     $field->setValue(UTIL_HtmlTag::generateAutoId('mailbox_new_message_' . $opponentId));
     $this->addElement($field);
     $field = new HiddenField('opponentId');
     $field->setValue($opponentId);
     $this->addElement($field);
     $field = new TextField('subject');
     $field->setInvitation(OW::getLanguage()->text('mailbox', 'subject'));
     $field->setHasInvitation(true);
     $field->setRequired();
     $this->addElement($field);
     $field = new Textarea('message');
     $field->setInvitation(OW::getLanguage()->text('mailbox', 'text_message_invitation'));
     $field->setHasInvitation(true);
     $field->setRequired();
     $this->addElement($field);
     $field = new HiddenField('attachment');
     $this->addElement($field);
     $submit = new Submit('sendBtn');
     $submit->setId('sendBtn');
     $submit->setValue(OW::getLanguage()->text('mailbox', 'add_button'));
     $this->addElement($submit);
     if (!OW::getRequest()->isAjax()) {
         $js = UTIL_JsGenerator::composeJsString('
         owForms["composeMessageForm"].bind( "submit", function( r )
         {
             $("#newmessage-mail-send-btn").addClass("owm_preloader_circle");
         });');
         OW::getDocument()->addOnloadScript($js);
     }
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:35,代码来源:compose_message_form.php

示例5: __construct

 public function __construct($name, $senderId, $context = MCOMPOSE_BOL_Service::CONTEXT_USER, $initJs = true, $inPopup = true)
 {
     parent::__construct($name);
     $language = OW::getLanguage();
     $this->userId = $senderId;
     $this->context = $context;
     $this->setAction(OW::getRouter()->urlFor('MCOMPOSE_CTRL_Compose', 'send', array('userId' => $senderId, 'formName' => $this->getName())));
     $this->setMethod(self::METHOD_POST);
     $this->setId($this->getName());
     $this->setEnctype('multipart/form-data');
     $this->setAjax();
     $this->setAjaxResetOnSuccess(false);
     $to = new MCOMPOSE_CLASS_UserSelectField('recipients', OW::getLanguage()->text('mcompose', 'selector_invitation_label'));
     $to->setRequired();
     $this->addElement($to);
     //thickbox
     $validatorSubject = new StringValidator(0, 2048);
     $validatorSubject->setErrorMessage($language->text('mailbox', 'message_too_long_error', array('maxLength' => 2048)));
     $subject = new TextField('subject');
     $subject->setInvitation('Subject');
     $subject->setHasInvitation(true);
     $subject->setLabel($language->text('mailbox', 'subject'))->addAttribute('class', 'ow_text');
     $subject->addValidator($validatorSubject);
     $subject->setRequired(true);
     $this->addElement($subject);
     $validatorTextarea = new StringValidator(0, 24000);
     $validatorTextarea->setErrorMessage($language->text('mailbox', 'message_too_long_error', array('maxLength' => 24000)));
     $message = new WysiwygTextarea('message', array(BOL_TextFormatService::WS_BTN_IMAGE, BOL_TextFormatService::WS_BTN_VIDEO), true);
     $message->setLabel($language->text('mailbox', 'text'))->addAttribute('class', 'ow_text');
     $message->setSize(300);
     $message->addValidator($validatorTextarea);
     $message->setRequired(true);
     $this->addElement($message);
     if (OW::getConfig()->getValue('mailbox', 'enable_attachments')) {
         $multiUpload = new MAILBOX_CLASS_AjaxFileUpload('attachments');
         //$multiUpload->setId('attachments');
         $this->addElement($multiUpload);
     }
     // Captcha
     $captcha = new MailboxCaptchaField('captcha');
     $captcha->addValidator(new MailboxCaptchaValidator($captcha->getId()));
     $captcha->addAttribute('disabled', 'disabled');
     $this->addElement($captcha);
     $submit = new Submit('send');
     $submit->setValue($language->text('mailbox', 'send_button'));
     $submit->addAttribute('class', 'ow_button ow_ic_mail');
     $this->addElement($submit);
     if ($initJs) {
         $js = "owForms['" . $this->getName() . "'].bind( 'success',\n            function( json )\n            {\n                var _complete = function(){ \n                    if ( _scope.floatBox ) _scope.floatBox.close();\n                };\n\n                var form = \$('#" . $this->getName() . "');\n                var captcha = form.find('input[name=captcha]');\n\n                if ( json.result == 'permission_denied' )\n                {\n                    if ( json.message )\n                    {\n                        OW.error(json.message);\n                    }\n                    else\n                    {\n                        OW.error(" . json_encode(OW::getLanguage()->text('mailbox', 'write_permission_denied')) . ");\n                    }\n                    \n                    _complete();\n                }\n                else if ( json.result == 'display_captcha' )\n            \t{\n                   window." . $captcha->jsObjectName . ".refresh();\n\n                   if ( captcha.attr('disabled') != 'disabled' )\n                   {\n                        owForms['" . $this->getName() . "'].getElement('captcha').showError(" . json_encode(OW::getLanguage()->text('base', 'form_validator_captcha_error_message')) . ");\n                   }\n                   else\n                   {\n                        captcha.removeAttr('disabled');\n                   }\n\n                   form.find('tr.captcha').show();\n                   form.find('tr.mailbox_conversation').hide();\n                }\n                else if ( json.result == true )\n            \t{\n                    captcha.attr('disabled','disabled');\n                    form.find('tr.captcha').hide();\n                    window." . $captcha->jsObjectName . ".refresh();\n\n                    form.find('tr.captcha').hide();\n                    form.find('tr.mailbox_conversation').show();\n\n                    owForms['" . $this->getName() . "'].resetForm();\n                    form.find('textarea[name=message]').get(0).htmlareaRefresh();\n\n                    if ( json.error )\n                        OW.error(json.error);\n\n                    if ( json.warning )\n                        OW.warning(json.warning);\n\n                     if ( json.message )\n                        OW.info(json.message);\n                        \n                    _complete();\n                }\n                else if ( json.error )\n                {\n                    OW.error(json.error);\n                    \n                    _complete();\n                }\n\n            }); ";
         OW::getDocument()->addOnloadScript($js);
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:52,代码来源:form.php

示例6: __construct

 public function __construct($photoId = NULL)
 {
     parent::__construct('photo-edit-form');
     $this->setAjax(TRUE);
     $this->setAction(OW::getRouter()->urlFor('PHOTO_CTRL_Photo', 'ajaxUpdatePhoto'));
     $this->bindJsFunction('success', 'function( data )
         {
             OW.trigger("photo.afterPhotoEdit", data);
         }');
     $photo = PHOTO_BOL_PhotoService::getInstance()->findPhotoById($photoId);
     $album = PHOTO_BOL_PhotoAlbumService::getInstance()->findAlbumById($photo->albumId);
     $photoIdField = new HiddenField('photoId');
     $photoIdField->setRequired(TRUE);
     $photoIdField->setValue($photo->id);
     $photoIdField->addValidator(new PHOTO_CLASS_PhotoOwnerValidator());
     $this->addElement($photoIdField);
     $albumField = new TextField('album');
     $albumField->setId('ajax-upload-album');
     $albumField->setRequired();
     $albumField->setValue($album->name);
     $albumField->setLabel(OW::getLanguage()->text('photo', 'create_album'));
     $albumField->addAttribute('class', 'ow_dropdown_btn ow_inputready ow_cursor_pointer');
     $albumField->addAttribute('autocomplete', 'off');
     $albumField->addAttribute('readonly');
     $this->addElement($albumField);
     $albumNameField = new TextField('album-name');
     $albumNameField->setRequired();
     $albumNameField->setValue($album->name);
     $albumNameField->addValidator(new PHOTO_CLASS_AlbumNameValidator(FALSE, NULL, $album->name));
     $albumNameField->setHasInvitation(TRUE);
     $albumNameField->setInvitation(OW::getLanguage()->text('photo', 'album_name'));
     $albumNameField->addAttribute('class', 'ow_smallmargin invitation');
     $this->addElement($albumNameField);
     $desc = new Textarea('description');
     $desc->setHasInvitation(TRUE);
     $desc->setInvitation(OW::getLanguage()->text('photo', 'album_desc'));
     $this->addElement($desc);
     $photoDesc = new PHOTO_CLASS_HashtagFormElement('photo-desc');
     $photoDesc->setValue($photo->description);
     $photoDesc->setLabel(OW::getLanguage()->text('photo', 'album_desc'));
     $this->addElement($photoDesc);
     $submit = new Submit('edit');
     $submit->setValue(OW::getLanguage()->text('photo', 'btn_edit'));
     $this->addElement($submit);
 }
开发者ID:tammyrocks,项目名称:photo,代码行数:45,代码来源:edit_form.php

示例7: __construct

    public function __construct($userId)
    {
        parent::__construct();
        $form = new Form("send_message_form");
        $form->setAjax(true);
        $form->setAjaxResetOnSuccess(true);
        $form->setAction(OW::getRouter()->urlFor('BASE_CTRL_AjaxSendMessageToEmail', 'sendMessage'));
        $user = new HiddenField("userId");
        $user->setValue($userId);
        $form->addElement($user);
        $subject = new TextField('subject');
        $subject->setInvitation(OW::getLanguage()->text('base', 'subject'));
        $subject->setRequired(true);
        $form->addElement($subject);
        $textarea = new WysiwygTextarea("message");
        $textarea->setInvitation(OW::getLanguage()->text('base', 'message_invitation'));
        $requiredValidator = new WyswygRequiredValidator();
        $requiredValidator->setErrorMessage(OW::getLanguage()->text('base', 'message_empty'));
        $textarea->addValidator($requiredValidator);
        $form->addElement($textarea);
        $submit = new Submit('send');
        $submit->setLabel(OW::getLanguage()->text('base', 'send'));
        $form->addElement($submit);
        $form->bindJsFunction(Form::BIND_SUCCESS, ' function ( data ) {

            if ( data.result )
            {
                OW.info(data.message);
            }
            else
            {
                OW.error(data.message);
            }

            if ( OW.getActiveFloatBox() )
            {
                OW.getActiveFloatBox().close();
            }

        } ');
        $this->addForm($form);
    }
开发者ID:ZyXelP,项目名称:oxwall,代码行数:42,代码来源:send_message_to_email.php

示例8: __construct

 public function __construct($name, $affiliateId = null)
 {
     parent::__construct($name);
     $this->setAction(OW::getRouter()->urlForRoute('ocsaffiliates.action_assign_user'));
     $this->setAjax();
     $this->setAjaxResetOnSuccess(false);
     $lang = OW::getLanguage();
     $user = new TextField('user');
     $user->setLabel($lang->text('ocsaffiliates', 'assign_to_username'));
     $user->setInvitation($lang->text('ocsaffiliates', 'username'));
     $user->setHasInvitation(true);
     $user->setRequired(true);
     $this->addElement($user);
     $affiliate = new HiddenField('affiliateId');
     $affiliate->setRequired(true);
     $this->addElement($affiliate);
     $submit = new Submit('assign');
     $submit->setValue($lang->text('ocsaffiliates', 'assign_btn'));
     $this->addElement($submit);
     $this->bindJsFunction(Form::BIND_SUCCESS, "function(data){\n            if ( data.result == 'false' ) {\n                OW.error(data.error);\n            }\n            else {\n                document.location.reload();\n            }\n        }");
 }
开发者ID:vazahat,项目名称:dudex,代码行数:21,代码来源:assign_user_form.php

示例9: dept

 public function dept()
 {
     $this->setPageTitle(OW::getLanguage()->text('contactus', 'admin_dept_title'));
     $this->setPageHeading(OW::getLanguage()->text('contactus', 'admin_dept_heading'));
     $contactEmails = array();
     $deleteUrls = array();
     $contacts = CONTACTUS_BOL_Service::getInstance()->getDepartmentList();
     foreach ($contacts as $contact) {
         /* @var $contact CONTACTUS_BOL_Department */
         $contactEmails[$contact->id]['name'] = $contact->id;
         $contactEmails[$contact->id]['email'] = $contact->email;
         $contactEmails[$contact->id]['label'] = CONTACTUS_BOL_Service::getInstance()->getDepartmentLabel($contact->id);
         $deleteUrls[$contact->id] = OW::getRouter()->urlFor(__CLASS__, 'delete', array('id' => $contact->id));
     }
     $this->assign('contacts', $contactEmails);
     $this->assign('deleteUrls', $deleteUrls);
     $form = new Form('add_dept');
     $this->addForm($form);
     $fieldEmail = new TextField('email');
     $fieldEmail->setRequired();
     $fieldEmail->addValidator(new EmailValidator());
     $fieldEmail->setInvitation(OW::getLanguage()->text('contactus', 'label_invitation_email'));
     $fieldEmail->setHasInvitation(true);
     $form->addElement($fieldEmail);
     $fieldLabel = new TextField('label');
     $fieldLabel->setRequired();
     $fieldLabel->setInvitation(OW::getLanguage()->text('contactus', 'label_invitation_label'));
     $fieldLabel->setHasInvitation(true);
     $form->addElement($fieldLabel);
     $submit = new Submit('add');
     $submit->setValue(OW::getLanguage()->text('contactus', 'form_add_dept_submit'));
     $form->addElement($submit);
     if (OW::getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $data = $form->getValues();
             CONTACTUS_BOL_Service::getInstance()->addDepartment($data['email'], $data['label']);
             $this->redirect();
         }
     }
 }
开发者ID:vazahat,项目名称:dudex,代码行数:40,代码来源:admin.php

示例10: categories

 public function categories()
 {
     $adminForm = new Form('categoriesForm');
     $language = OW::getLanguage();
     $element = new TextField('categoryName');
     $element->setRequired();
     $element->setInvitation($language->text('advancedphoto', 'admin_category_name'));
     $element->setHasInvitation(true);
     $adminForm->addElement($element);
     $element = new Submit('addCategory');
     $element->setValue($language->text('advancedphoto', 'admin_add_category'));
     $adminForm->addElement($element);
     if (OW::getRequest()->isPost()) {
         if ($adminForm->isValid($_POST)) {
             $values = $adminForm->getValues();
             $name = ucwords(strtolower($values['categoryName']));
             $desc = ucwords(strtolower($values['categoryDesc']));
             if (ADVANCEDPHOTO_BOL_CategoryService::getInstance()->addCategory($name, $desc)) {
                 OW::getFeedback()->info($language->text('advancedphoto', 'admin_add_category_success'));
             } else {
                 OW::getFeedback()->error($language->text('advancedphoto', 'admin_add_category_error'));
             }
             $this->redirect();
         }
     }
     $this->addForm($adminForm);
     $allCategories = array();
     $deleteUrls = array();
     $categories = ADVANCEDPHOTO_BOL_CategoryService::getInstance()->getCategoriesList();
     foreach ($categories as $category) {
         $allCategories[$category->id]['id'] = $category->id;
         $allCategories[$category->id]['name'] = $category->name;
         $deleteUrls[$category->id] = OW::getRouter()->urlFor(__CLASS__, 'delete', array('id' => $category->id));
     }
     $this->assign('allCategories', $allCategories);
     $this->assign('deleteUrls', $deleteUrls);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:37,代码来源:admin.php

示例11: __construct

 /**
  * Class constructor
  *
  */
 public function __construct($maxUploadMaxFilesize)
 {
     parent::__construct('userSettingsForm');
     $this->setEnctype("multipart/form-data");
     $language = OW::getLanguage();
     // avatar size Field
     $avatarSize = new TextField('avatarSize');
     $avatarSize->setRequired(true);
     $validator = new IntValidator(40, 150);
     $validator->setErrorMessage($language->text('admin', 'user_settings_avatar_size_error', array('max' => 150)));
     $avatarSize->addValidator($validator);
     $this->addElement($avatarSize->setLabel($language->text('admin', 'user_settings_avatar_size_label')));
     // big avatar size Field
     $bigAvatarSize = new TextField('bigAvatarSize');
     $bigAvatarSize->setRequired(true);
     $validator = new IntValidator(150, 250);
     $validator->setErrorMessage($language->text('admin', 'user_settings_big_avatar_size_error', array('max' => 250)));
     $bigAvatarSize->addValidator($validator);
     $this->addElement($bigAvatarSize->setLabel($language->text('admin', 'user_settings_big_avatar_size_label')));
     // --- avatar max size
     $maxUploadMaxFilesizeValidator = new FloatValidator(0, $maxUploadMaxFilesize);
     $maxUploadMaxFilesizeValidator->setErrorMessage($language->text('admin', 'settings_max_upload_size_error'));
     $avatarMaxUploadSize = new TextField('avatar_max_upload_size');
     $avatarMaxUploadSize->setLabel($language->text('admin', 'input_settings_avatar_max_upload_size_label'));
     $avatarMaxUploadSize->addValidator($maxUploadMaxFilesizeValidator);
     $this->addElement($avatarMaxUploadSize);
     // --- avatar max size
     if (!defined('OW_PLUGIN_XP')) {
         // confirm Email
         $confirmEmail = new CheckboxField('confirmEmail');
         $confirmEmail->setValue(OW::getConfig()->getValue('base', 'confirm_email'));
         $this->addElement($confirmEmail->setLabel($language->text('admin', 'user_settings_confirm_email')));
     }
     // display name Field
     $displayNameField = new Selectbox('displayName');
     $displayNameField->setRequired(true);
     $questions = array('username' => $language->text('base', 'questions_question_username_label'), 'realname' => $language->text('base', 'questions_question_realname_label'));
     $displayNameField->setHasInvitation(false);
     $displayNameField->setOptions($questions);
     $this->addElement($displayNameField->setLabel($language->text('admin', 'user_settings_display_name')));
     $avatar = new FileField('avatar');
     $this->addElement($avatar);
     $bigAvatar = new FileField('bigAvatar');
     $this->addElement($bigAvatar);
     // --
     $joinConfigField = new Selectbox('join_display_photo_upload');
     $options = array(BOL_UserService::CONFIG_JOIN_DISPLAY_PHOTO_UPLOAD => $language->text('base', 'config_join_display_photo_upload_display_label'), BOL_UserService::CONFIG_JOIN_DISPLAY_AND_SET_REQUIRED_PHOTO_UPLOAD => $language->text('base', 'config_join_display_photo_upload_display_and_require_label'), BOL_UserService::CONFIG_JOIN_NOT_DISPLAY_PHOTO_UPLOAD => $language->text('base', 'config_join_display_photo_upload_not_display_label'));
     $joinConfigField->addOptions($options);
     $joinConfigField->setHasInvitation(false);
     $joinConfigField->setValue(OW::getConfig()->getValue('base', 'join_display_photo_upload'));
     $this->addElement($joinConfigField);
     // --
     $joinConfigField = new CheckboxField('join_display_terms_of_use');
     $joinConfigField->setValue(OW::getConfig()->getValue('base', 'join_display_terms_of_use'));
     $this->addElement($joinConfigField);
     //--- privacy -----///
     $config = OW::getConfig();
     $baseConfigs = $config->getValues('base');
     $userApprove = new CheckboxField('user_approve');
     $userApprove->setLabel($language->text('admin', 'permissions_index_user_approve'));
     $this->addElement($userApprove);
     $whoCanJoin = new RadioField('who_can_join');
     $whoCanJoin->addOptions(array('1' => $language->text('admin', 'permissions_index_anyone_can_join'), '2' => $language->text('admin', 'permissions_index_by_invitation_only_can_join')));
     $whoCanJoin->setLabel($language->text('admin', 'permissions_index_who_can_join'));
     $this->addElement($whoCanJoin);
     $whoCanInvite = new RadioField('who_can_invite');
     $whoCanInvite->addOptions(array('1' => $language->text('admin', 'permissions_index_all_users_can_invate'), '2' => $language->text('admin', 'permissions_index_admin_only_can_invate')));
     $whoCanInvite->setLabel($language->text('admin', 'permissions_index_who_can_invite'));
     $this->addElement($whoCanInvite);
     $guestsCanView = new RadioField('guests_can_view');
     $guestsCanView->addOptions(array('1' => $language->text('admin', 'permissions_index_yes'), '2' => $language->text('admin', 'permissions_index_no'), '3' => $language->text('admin', 'permissions_index_with_password')));
     $guestsCanView->setLabel($language->text('admin', 'permissions_index_guests_can_view_site'));
     $guestsCanView->setDescription($language->text('admin', 'permissions_idex_if_not_yes_will_override_settings'));
     $this->addElement($guestsCanView);
     $password = new TextField('password');
     $password->setHasInvitation(true);
     if ($baseConfigs['guests_can_view'] == 3) {
         $password->setInvitation($language->text('admin', 'change_password'));
     } else {
         $password->setInvitation($language->text('admin', 'add_password'));
     }
     $this->addElement($password);
     // --- //
     //-- profile questions --//
     $userViewPresentationnew = new CheckboxField("user_view_presentation");
     $userViewPresentationnew->setLabel($language->text('base', 'questions_config_user_view_presentation_label'));
     $userViewPresentationnew->setDescription($language->text('base', 'questions_config_user_view_presentation_description'));
     $this->addElement($userViewPresentationnew);
     // --- //
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('admin', 'save_btn_label'));
     $this->addElement($submit);
 }
开发者ID:ZyXelP,项目名称:oxwall,代码行数:98,代码来源:settings.php

示例12: index

 public function index()
 {
     $language = OW::getLanguage();
     $config = OW::getConfig();
     $baseConfigs = $config->getValues('base');
     $form = new Form('privacy_settings');
     $userApprove = new CheckboxField('user_approve');
     $userApprove->setLabel($language->text('admin', 'permissions_index_user_approve'));
     $form->addElement($userApprove);
     $whoCanJoin = new RadioField('who_can_join');
     $whoCanJoin->addOptions(array('1' => $language->text('admin', 'permissions_index_anyone_can_join'), '2' => $language->text('admin', 'permissions_index_by_invitation_only_can_join')));
     $whoCanJoin->setLabel($language->text('admin', 'permissions_index_who_can_join'));
     $form->addElement($whoCanJoin);
     $whoCanInvite = new RadioField('who_can_invite');
     $whoCanInvite->addOptions(array('1' => $language->text('admin', 'permissions_index_all_users_can_invate'), '2' => $language->text('admin', 'permissions_index_admin_only_can_invate')));
     $whoCanInvite->setLabel($language->text('admin', 'permissions_index_who_can_invite'));
     $form->addElement($whoCanInvite);
     $guestsCanView = new RadioField('guests_can_view');
     $guestsCanView->addOptions(array('1' => $language->text('admin', 'permissions_index_yes'), '2' => $language->text('admin', 'permissions_index_no'), '3' => $language->text('admin', 'permissions_index_with_password')));
     $guestsCanView->setLabel($language->text('admin', 'permissions_index_guests_can_view_site'));
     $guestsCanView->setDescription($language->text('admin', 'permissions_idex_if_not_yes_will_override_settings'));
     $form->addElement($guestsCanView);
     $password = new TextField('password');
     $password->setHasInvitation(true);
     if ($baseConfigs['guests_can_view'] == 3) {
         $password->setInvitation($language->text('admin', 'change_password'));
     } else {
         $password->setInvitation($language->text('admin', 'add_password'));
     }
     $form->addElement($password);
     $submit = new Submit('save');
     $submit->setValue($language->text('admin', 'permissions_index_save'));
     $form->addElement($submit);
     $this->addForm($form);
     if (OW::getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $data = $form->getValues();
             $config->saveConfig('base', 'who_can_join', (int) $data['who_can_join']);
             $config->saveConfig('base', 'who_can_invite', (int) $data['who_can_invite']);
             $config->saveConfig('base', 'mandatory_user_approve', (bool) $data['user_approve'] ? 1 : 0);
             if ((int) $data['guests_can_view'] === 3 && empty($data['password'])) {
                 OW::getFeedback()->error($language->text('admin', 'permission_global_privacy_empty_pass_error_message'));
                 return;
             } else {
                 if ((int) $data['guests_can_view'] === 3 && strlen(trim($data['password'])) < 4) {
                     OW::getFeedback()->error($language->text('admin', 'permission_global_privacy_pass_length_error_message'));
                     return;
                 } else {
                     $adminEmail = OW::getUser()->getEmail();
                     $senderMail = $config->getValue('base', 'site_email');
                     $mail = OW::getMailer()->createMail();
                     $mail->addRecipientEmail($adminEmail);
                     $mail->setSender($senderMail);
                     $mail->setSenderSuffix(false);
                     $mail->setSubject(OW::getLanguage()->text('admin', 'site_password'));
                     $mail->setTextContent(OW::getLanguage()->text('admin', 'admin_password', array('password' => $data['password'])));
                     try {
                         OW::getMailer()->send($mail);
                     } catch (Exception $e) {
                         $logger = OW::getLogger('admin.send_password_message');
                         $logger->addEntry($e->getMessage());
                         $logger->writeLog();
                     }
                     $data['password'] = crypt($data['password'], OW_PASSWORD_SALT);
                     $config->saveConfig('base', 'guests_can_view', (int) $data['guests_can_view']);
                     $config->saveConfig('base', 'guests_can_view_password', $data['password']);
                 }
             }
             OW::getFeedback()->info($language->text('admin', 'permission_global_privacy_settings_success_message'));
             $this->redirect();
         }
     }
     $baseConfigs = $config->getValues('base');
     $form->getElement('who_can_join')->setValue($baseConfigs['who_can_join']);
     $form->getElement('who_can_invite')->setValue($baseConfigs['who_can_invite']);
     $form->getElement('guests_can_view')->setValue($baseConfigs['guests_can_view']);
     $form->getElement('user_approve')->setValue($baseConfigs['mandatory_user_approve']);
 }
开发者ID:ZyXelP,项目名称:oxwall,代码行数:78,代码来源:permissions.php

示例13: sponsor

 public function sponsor()
 {
     $language = OW::getLanguage();
     $config = OW::getConfig();
     $sponsorForm = new Form('sponsorForm');
     $sponsorForm->setEnctype('multipart/form-data');
     $element = new TextField('sponsorName');
     $element->setRequired(true);
     $element->setLabel($language->text('sponsors', 'sponsor_name'));
     $element->setInvitation($language->text('sponsors', 'sponsor_name_desc'));
     $element->setHasInvitation(true);
     $sponsorForm->addElement($element);
     $element = new TextField('sponsorEmail');
     $element->setRequired(true);
     $validator = new EmailValidator();
     $validator->setErrorMessage($language->text('sponsors', 'invalid_email_format'));
     $element->addValidator($validator);
     $element->setLabel($language->text('sponsors', 'sponsor_email'));
     $element->setInvitation($language->text('sponsors', 'sponsor_email_desc'));
     $element->setHasInvitation(true);
     $sponsorForm->addElement($element);
     $element = new TextField('sponsorWebsite');
     $element->setRequired(true);
     $validator = new UrlValidator();
     $validator->setErrorMessage($language->text('sponsors', 'invalid_url_format'));
     $element->addValidator($validator);
     $element->setLabel($language->text('sponsors', 'sponsor_website'));
     $element->setInvitation($language->text('sponsors', 'sponsor_website_desc'));
     $element->setHasInvitation(true);
     $sponsorForm->addElement($element);
     if ($config->getValue('sponsors', 'minimumPayment') > 0) {
         $element = new TextField('sponsorAmount');
         $element->setRequired(true);
         $element->setValue($config->getValue('sponsors', 'minimumPayment'));
         $minAmount = $config->getValue('sponsors', 'minimumPayment');
         $validator = new FloatValidator($minAmount);
         $validator->setErrorMessage($language->text('sponsors', 'invalid_sponsor_amount', array('minAmount' => $minAmount)));
         $element->addValidator($validator);
         $element->setLabel($language->text('sponsors', 'sponsor_payment_amount'));
         $element->setInvitation($language->text('sponsors', 'sponsor_payment_amount_desc', array('minAmount' => $minAmount)));
         $element->setHasInvitation(true);
         $sponsorForm->addElement($element);
     }
     $element = new FileField('sponsorImage');
     $element->setLabel($language->text('sponsors', 'sponsorsh_image_file'));
     $sponsorForm->addElement($element);
     if ($config->getValue('sponsors', 'minimumPayment') > 0) {
         $element = new BillingGatewaySelectionField('gateway');
         $element->setRequired(true);
         $element->setLabel($language->text('sponsors', 'payment_gatway_selection'));
         $sponsorForm->addElement($element);
     }
     $element = new Submit('becomeSponsor');
     $element->setValue(OW::getLanguage()->text('sponsors', 'become_sponsor_btn'));
     $sponsorForm->addElement($element);
     if (OW::getRequest()->isPost()) {
         if ($sponsorForm->isValid($_POST)) {
             $values = $sponsorForm->getValues();
             if (isset($_FILES['sponsorImage']) && in_array(UTIL_File::getExtension($_FILES['sponsorImage']['name']), $this->allowedImageExtensions)) {
                 $backupPath = OW::getPluginManager()->getPlugin('sponsors')->getUserFilesDir() . $_FILES['sponsorImage']['name'];
                 move_uploaded_file($_FILES['sponsorImage']['tmp_name'], $backupPath);
                 $sponsorImageFile = $_FILES['sponsorImage']['name'];
             } else {
                 $sponsorImageFile = "defaultSponsor.jpg";
             }
             if (isset($values['sponsorAmount']) && $values['gateway']) {
                 $billingService = BOL_BillingService::getInstance();
                 if (empty($values['gateway']['url']) || empty($values['gateway']['key']) || !($gateway = $billingService->findGatewayByKey($values['gateway']['key']) || !$gateway->active)) {
                     OW::getFeedback()->error($language->text('base', 'billing_gateway_not_found'));
                     $this->redirect();
                 }
                 $productAdapter = new SPONSORS_CLASS_SponsorProductAdapter();
                 $sale = new BOL_BillingSale();
                 $sale->pluginKey = 'sponsors';
                 $sale->entityDescription = $language->text('sponsors', 'sponsor_payment_gateway_text');
                 $sale->entityKey = $productAdapter->getProductKey();
                 $sale->entityId = time();
                 $sale->price = floatval($values['sponsorAmount']);
                 $sale->period = null;
                 $sale->userId = OW::getUser()->getId() ? OW::getUser()->getId() : 0;
                 $sale->recurring = 0;
                 $extraData = array();
                 $extraData['sponsorName'] = $values['sponsorName'];
                 $extraData['sponsorEmail'] = $values['sponsorEmail'];
                 $extraData['sponsorWebsite'] = $values['sponsorWebsite'];
                 $extraData['sponsorAmount'] = $values['sponsorAmount'];
                 $extraData['sponsorImage'] = $sponsorImageFile;
                 $extraData['status'] = $config->getValue('sponsors', 'autoApprove') == '1' ? 1 : 0;
                 $extraData['validity'] = $config->getValue('sponsors', 'sponsorValidity');
                 $sale->setExtraData($extraData);
                 $saleId = $billingService->initSale($sale, $values['gateway']['key']);
                 if ($saleId) {
                     $billingService->storeSaleInSession($saleId);
                     $billingService->setSessionBackUrl($productAdapter->getProductOrderUrl());
                     OW::getApplication()->redirect($values['gateway']['url']);
                 }
             } else {
                 $sponsor = new SPONSORS_BOL_Sponsor();
                 $sponsor->name = $values['sponsorName'];
                 $sponsor->email = $values['sponsorEmail'];
//.........这里部分代码省略.........
开发者ID:vazahat,项目名称:dudex,代码行数:101,代码来源:sponsors.php

示例14: __construct

    public function __construct()
    {
        parent::__construct(self::FORM_NAME);
        $language = OW::getLanguage();
        $this->setAjax();
        $this->setAjaxResetOnSuccess(false);
        $this->setAction(OW::getRouter()->urlFor('PHOTO_CTRL_AjaxUpload', 'checkFakeAlbumData'));
        $this->bindJsFunction(self::BIND_SUCCESS, UTIL_JsGenerator::composeJsString('function( data )
        {
            if ( !data.result )
            {
                var form = owForms[this.name];

                Object.keys(data.errors).forEach(function( item )
                {
                    var arr = data.errors[item];

                    if ( arr.length !== 0 )
                    {
                        form.getElement(item).showError(arr.shift());
                    }
                });

                return;
            }

            if ( OW.getActiveFloatBox() ) OW.getActiveFloatBox().close();

            var formData = data.data;
            var params = {
                albumId: 0,
                albumName: formData[{$album_name}],
                albumDescription: formData[{$album_desc}],
                url: "",
                data: formData
            };
            var ajaxUploadPhotoFB = OW.ajaxFloatBox("PHOTO_CMP_AjaxUpload", params, {
                title: {$title},
                width: "746px",
                onLoad: function()
                {
                    OW.trigger("photo.ready_fake_album", [formData]);
                }
            });

            ajaxUploadPhotoFB.bind("close", function()
            {
                if ( ajaxPhotoUploader.isHasData() )
                {
                    if ( confirm({$confirm}) )
                    {
                        OW.trigger("photo.onCloseUploaderFloatBox");

                        return true;
                    }

                    return false;
                }
                else
                {
                    OW.trigger("photo.onCloseUploaderFloatBox");
                }
            });
        }', array('album_name' => self::ELEMENT_ALBUM_NAME, 'album_desc' => self::ELEMENT_ALBUM_DESC, 'title' => $language->text('photo', 'upload_photos'), 'confirm' => $language->text('photo', 'close_alert'))));
        $albumNameInput = new TextField(self::ELEMENT_ALBUM_NAME);
        $albumNameInput->setRequired();
        $albumNameInput->addValidator(new PHOTO_CLASS_AlbumNameValidator(false));
        $albumNameInput->setHasInvitation(true);
        $albumNameInput->setInvitation($language->text('photo', 'album_name'));
        $this->addElement($albumNameInput);
        $albumDescInput = new Textarea(self::ELEMENT_ALBUM_DESC);
        $albumDescInput->setHasInvitation(true);
        $albumDescInput->setInvitation($language->text('photo', 'album_desc'));
        $this->addElement($albumDescInput);
        $submit = new Submit(self::SUBMIT_SUBMIT);
        $submit->setValue($language->text('photo', 'add_photos'));
        $this->addElement($submit);
        $this->triggerReady();
    }
开发者ID:tammyrocks,项目名称:photo,代码行数:79,代码来源:create_fake_album_form.php

示例15: edit

 public function edit($params)
 {
     if (!isset($params['id']) || !($id = (int) $params['id'])) {
         throw new Redirect404Exception();
         return;
     }
     $language = OW::getLanguage();
     $config = OW::getConfig();
     $sponsor = SPONSORS_BOL_Service::getInstance()->findSponsorById($id);
     if (!$sponsor->id) {
         throw new Redirect404Exception();
         return;
     }
     $sponsorForm = new Form('sponsorForm');
     $sponsorForm->setEnctype('multipart/form-data');
     $element = new TextField('sponsorName');
     $element->setRequired(true);
     $element->setLabel($language->text('sponsors', 'sponsor_name'));
     $element->setInvitation($language->text('sponsors', 'sponsor_name_desc'));
     $element->setValue($sponsor->name);
     $element->setHasInvitation(true);
     $sponsorForm->addElement($element);
     $element = new TextField('sponsorEmail');
     $element->setRequired(true);
     $validator = new EmailValidator();
     $validator->setErrorMessage($language->text('sponsors', 'invalid_email_format'));
     $element->addValidator($validator);
     $element->setLabel($language->text('sponsors', 'sponsor_email'));
     $element->setInvitation($language->text('sponsors', 'sponsor_email_desc'));
     $element->setValue($sponsor->email);
     $element->setHasInvitation(true);
     $sponsorForm->addElement($element);
     $element = new TextField('sponsorWebsite');
     $element->setRequired(true);
     $validator = new UrlValidator();
     $validator->setErrorMessage($language->text('sponsors', 'invalid_url_format'));
     $element->addValidator($validator);
     $element->setLabel($language->text('sponsors', 'sponsor_website'));
     $element->setInvitation($language->text('sponsors', 'sponsor_website_desc'));
     $element->setHasInvitation(true);
     $element->setValue($sponsor->website);
     $sponsorForm->addElement($element);
     $element = new TextField('sponsorAmount');
     $element->setRequired(true);
     $minAmount = $config->getValue('sponsors', 'minimumPayment');
     $validator = new FloatValidator(0);
     $validator->setErrorMessage($language->text('sponsors', 'invalid_amount_value'));
     $element->addValidator($validator);
     $element->setLabel($language->text('sponsors', 'sponsor_payment_amount'));
     $element->setInvitation($language->text('sponsors', 'admin_payment_amount_desc'));
     $element->setHasInvitation(true);
     $element->setValue($sponsor->price);
     $sponsorForm->addElement($element);
     $element = new TextField('sponsorValidity');
     $element->setRequired(true);
     $element->setValue($sponsor->validity);
     $validator = new IntValidator(0);
     $validator->setErrorMessage($language->text('sponsors', 'invalid_numeric_format'));
     $element->addValidator($validator);
     $element->setLabel($language->text('sponsors', 'sponsorship_validatity'));
     $element->setInvitation($language->text('sponsors', 'sponsorship_validatity_desc'));
     $element->setHasInvitation(true);
     $sponsorForm->addElement($element);
     $element = new FileField('sponsorImage');
     $element->setLabel($language->text('sponsors', 'sponsorsh_image_file'));
     $sponsorForm->addElement($element);
     $element = new Submit('editSponsor');
     $element->setValue(OW::getLanguage()->text('sponsors', 'edit_sponsor_btn'));
     $sponsorForm->addElement($element);
     if (OW::getRequest()->isPost()) {
         if ($sponsorForm->isValid($_POST)) {
             $values = $sponsorForm->getValues();
             $allowedImageExtensions = array('jpg', 'jpeg', 'gif', 'png', 'tiff');
             $sponsorImageFile = "";
             if (isset($_FILES['sponsorImage']) && in_array(UTIL_File::getExtension($_FILES['sponsorImage']['name']), $allowedImageExtensions)) {
                 $backupPath = OW::getPluginManager()->getPlugin('sponsors')->getUserFilesDir() . $_FILES['sponsorImage']['name'];
                 move_uploaded_file($_FILES['sponsorImage']['tmp_name'], $backupPath);
                 $sponsorImageFile = $_FILES['sponsorImage']['name'];
             }
             $sponsor->name = $values['sponsorName'];
             $sponsor->email = $values['sponsorEmail'];
             $sponsor->website = $values['sponsorWebsite'];
             $sponsor->price = $values['sponsorAmount'];
             if (!empty($sponsorImageFile)) {
                 $sponsor->image = $sponsorImageFile;
             }
             $sponsor->userId = $sponsor->userId;
             $sponsor->status = $sponsor->status;
             $sponsor->validity = $values['sponsorValidity'];
             if (SPONSORS_BOL_Service::getInstance()->addSponsor($sponsor)) {
                 OW::getFeedback()->info(OW::getLanguage()->text('sponsors', 'sponsor_edit_ok'));
             } else {
                 OW::getFeedback()->error(OW::getLanguage()->text('sponsors', 'sponsor_edit_error'));
             }
         }
     }
     $this->addForm($sponsorForm);
     $fields = array();
     foreach ($sponsorForm->getElements() as $element) {
         if (!$element instanceof HiddenField) {
//.........这里部分代码省略.........
开发者ID:vazahat,项目名称:dudex,代码行数:101,代码来源:admin.php


注:本文中的TextField::setInvitation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。