Exemple #1
0
 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'));
 }
    public function __construct()
    {
        parent::__construct('set-credits-form');
        $this->setAjax(true);
        $this->setAction(OW::getRouter()->urlFor('USERCREDITS_CTRL_Ajax', 'setCredits'));
        $lang = OW::getLanguage();
        $userIdField = new HiddenField('userId');
        $userIdField->setRequired(true);
        $this->addElement($userIdField);
        $balance = new TextField('balance');
        $this->addElement($balance);
        $submit = new Submit('save');
        $submit->setValue($lang->text('base', 'edit_button'));
        $this->addElement($submit);
        $js = 'owForms["' . $this->getName() . '"].bind("success", function(data){
            if ( data.error ){
                OW.error(data.error);
            }
            
            if ( data.message ) {
                OW.info(data.message);
            }

            _scope.floatBox && _scope.floatBox.close();
            _scope.callBack && _scope.callBack(data);
        });';
        OW::getDocument()->addOnloadScript($js);
    }
Exemple #3
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct('update-question-form');
     $this->setAction(OW::getRouter()->urlFor('OCSFAQ_CTRL_Admin', 'editQuestion'));
     $lang = OW::getLanguage();
     $questionId = new HiddenField('questionId');
     $questionId->setRequired(true);
     $this->addElement($questionId);
     $question = new TextField('question');
     $question->setRequired(true);
     $question->setLabel($lang->text('ocsfaq', 'question'));
     $this->addElement($question);
     $btnSet = array(BOL_TextFormatService::WS_BTN_IMAGE, BOL_TextFormatService::WS_BTN_VIDEO, BOL_TextFormatService::WS_BTN_HTML);
     $answer = new WysiwygTextarea('answer', $btnSet);
     $answer->setRequired(true);
     $answer->setLabel($lang->text('ocsfaq', 'answer'));
     $this->addElement($answer);
     $isFeatured = new CheckboxField('isFeatured');
     $isFeatured->setLabel($lang->text('ocsfaq', 'is_featured'));
     $this->addElement($isFeatured);
     $categories = OCSFAQ_BOL_FaqService::getInstance()->getCategories();
     if ($categories) {
         $category = new Selectbox('category');
         foreach ($categories as $cat) {
             $category->addOption($cat->id, $cat->name);
         }
         $category->setLabel($lang->text('ocsfaq', 'category'));
         $this->addElement($category);
     }
     // submit
     $submit = new Submit('update');
     $submit->setValue($lang->text('ocsfaq', 'btn_save'));
     $this->addElement($submit);
 }
Exemple #4
0
 public function __construct($albumId)
 {
     parent::__construct(self::FORM_NAME);
     $album = PHOTO_BOL_PhotoAlbumService::getInstance()->findAlbumById($albumId);
     $this->setAction(OW::getRouter()->urlForRoute('photo.ajax_update_photo'));
     $this->setAjax(true);
     $this->setAjaxResetOnSuccess(false);
     $albumIdField = new HiddenField(self::ELEMENT_ALBUM_ID);
     $albumIdField->setValue($album->id);
     $albumIdField->setRequired();
     $albumIdField->addValidator(new PHOTO_CLASS_AlbumOwnerValidator());
     $this->addElement($albumIdField);
     $albumNameField = new TextField(self::ELEMENT_ALBUM_NAME);
     $albumNameField->setValue($album->name);
     $albumNameField->setRequired();
     if ($album->name != trim(OW::getLanguage()->text('photo', 'newsfeed_album'))) {
         $albumNameField->addValidator(new PHOTO_CLASS_AlbumNameValidator(true, null, $album->name));
     }
     $albumNameField->addAttribute('class', 'ow_photo_album_name_input');
     $this->addElement($albumNameField);
     $desc = new Textarea(self::ELEMENT_DESC);
     $desc->setValue(!empty($album->description) ? $album->description : NULL);
     $desc->setHasInvitation(TRUE);
     $desc->setInvitation(OW::getLanguage()->text('photo', 'describe_photo'));
     $desc->addAttribute('class', 'ow_photo_album_description_textarea');
     $this->addElement($desc);
     $this->triggerReady(array('albumId' => $albumId));
 }
 public function __construct()
 {
     parent::__construct('delete-membership-form');
     $this->setAjaxResetOnSuccess(false);
     $this->setAjax(true);
     $this->setAction(OW::getRouter()->urlForRoute('membership_delete_type'));
     $lang = OW::getLanguage();
     $typeId = new HiddenField('typeId');
     $typeId->setRequired(true);
     $this->addElement($typeId);
     $newTypeId = new Selectbox('newTypeId');
     $newTypeId->setHasInvitation(false);
     $this->addElement($newTypeId);
     $types = new RadioGroupItemField('type');
     $types->setRequired(true);
     $types->setLabel($lang->text('membership', 'set_membership'));
     $this->addElement($types);
     $this->bindJsFunction(Form::BIND_SUCCESS, "function( data ) {\n                if ( data.result ) {\n                    document.location.reload();\n                }\n            }");
     $script = '$("#btn-confirm-type-delete").click(function(){
         if ( confirm(' . json_encode($lang->text('membership', 'type_delete_confirm')) . ') ) {
              $(this).parents("form:eq(0)").submit();
         }
     });
     ';
     OW::getDocument()->addOnloadScript($script);
 }
 public function __construct($albumId)
 {
     parent::__construct('albumEditForm');
     $album = PHOTO_BOL_PhotoAlbumService::getInstance()->findAlbumById($albumId);
     $this->setAction(OW::getRouter()->urlForRoute('photo.ajax_update_photo'));
     $this->setAjax(TRUE);
     $this->setAjaxResetOnSuccess(FALSE);
     $albumIdField = new HiddenField('album-id');
     $albumIdField->setValue($album->id);
     $albumIdField->setRequired();
     $albumIdField->addValidator(new PHOTO_CLASS_AlbumOwnerValidator());
     $this->addElement($albumIdField);
     $albumNameField = new TextField('albumName');
     $albumNameField->setValue($album->name);
     $albumNameField->setRequired();
     if ($album->name != trim(OW::getLanguage()->text('photo', 'newsfeed_album'))) {
         $albumNameField->addValidator(new PHOTO_CLASS_AlbumNameValidator(TRUE, NULL, $album->name));
     }
     $albumNameField->addAttribute('class', 'ow_photo_album_name_input');
     $this->addElement($albumNameField);
     $desc = new Textarea('desc');
     $desc->setValue(!empty($album->description) ? $album->description : NULL);
     $desc->setHasInvitation(TRUE);
     $desc->setInvitation(OW::getLanguage()->text('photo', 'describe_photo'));
     $desc->addAttribute('class', 'ow_photo_album_description_textarea');
     $this->addElement($desc);
 }
Exemple #7
0
 public function __construct()
 {
     parent::__construct('goal-edit-form');
     $this->setEnctype(Form::ENCTYPE_MULTYPART_FORMDATA);
     $lang = OW::getLanguage();
     $id = new HiddenField('projectId');
     $id->setRequired(true);
     $this->addElement($id);
     $name = new TextField('name');
     $name->setRequired(true);
     $name->setLabel($lang->text('ocsfundraising', 'name'));
     $this->addElement($name);
     $btnSet = array(BOL_TextFormatService::WS_BTN_IMAGE, BOL_TextFormatService::WS_BTN_VIDEO, BOL_TextFormatService::WS_BTN_HTML);
     $desc = new WysiwygTextarea('description', $btnSet);
     $desc->setRequired(true);
     $sValidator = new StringValidator(1, 50000);
     $desc->addValidator($sValidator);
     $desc->setLabel($lang->text('ocsfundraising', 'description'));
     $this->addElement($desc);
     $category = new Selectbox('category');
     $category->setLabel($lang->text('ocsfundraising', 'category'));
     $list = OCSFUNDRAISING_BOL_Service::getInstance()->getCategoryList();
     if ($list) {
         foreach ($list as $cat) {
             $category->addOption($cat->id, $lang->text('ocsfundraising', 'category_' . $cat->id));
         }
     }
     $this->addElement($category);
     $target = new TextField('target');
     $target->setRequired(true);
     $target->setLabel($lang->text('ocsfundraising', 'target_amount'));
     $this->addElement($target);
     $min = new TextField('min');
     $min->setLabel($lang->text('ocsfundraising', 'min_amount'));
     $min->setValue(1);
     $this->addElement($min);
     $end = new DateField('end');
     $end->setMinYear(date('Y'));
     $end->setMaxYear(date('Y') + 2);
     $end->setLabel($lang->text('ocsfundraising', 'end_date'));
     $this->addElement($end);
     $imageField = new FileField('image');
     $imageField->setLabel($lang->text('ocsfundraising', 'image_label'));
     $this->addElement($imageField);
     $submit = new Submit('edit');
     $submit->setLabel($lang->text('ocsfundraising', 'edit'));
     $this->addElement($submit);
 }
Exemple #8
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct('update-category-form');
     $this->setAction(OW::getRouter()->urlFor('OCSFAQ_CTRL_Admin', 'editCategory'));
     $lang = OW::getLanguage();
     $catId = new HiddenField('cId');
     $catId->setRequired(true);
     $this->addElement($catId);
     $name = new TextField('name');
     $name->setRequired(true);
     $name->setLabel($lang->text('ocsfaq', 'category'));
     $this->addElement($name);
     // submit
     $submit = new Submit('update');
     $submit->setValue($lang->text('ocsfaq', 'btn_save'));
     $this->addElement($submit);
 }
Exemple #9
0
 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);
 }
Exemple #10
0
 public function __construct()
 {
     parent::__construct('album-cover-maker');
     $this->setAjax(TRUE);
     $this->setAction(OW::getRouter()->urlForRoute('photo.ajax_album_cover'));
     $this->setAjaxResetOnSuccess(TRUE);
     $coords = new HiddenField('coords');
     $this->addElement($coords);
     $albumIdField = new HiddenField('albumId');
     $albumIdField->setRequired();
     $albumIdField->addValidator(new PHOTO_CLASS_AlbumOwnerValidator());
     $this->addElement($albumIdField);
     $photoIdField = new HiddenField('photoId');
     $this->addElement($photoIdField);
     $submit = new Submit('save');
     $submit->setValue(OW::getLanguage()->text('photo', 'btn_edit'));
     $this->addElement($submit);
 }
Exemple #11
0
 /**
  * Class constructor
  */
 public function __construct($photoId)
 {
     parent::__construct('photo-edit-form');
     $this->setAjax(true);
     $this->setAction(OW::getRouter()->urlFor('PHOTO_CTRL_Photo', 'ajaxUpdatePhoto'));
     $language = OW::getLanguage();
     $photo = PHOTO_BOL_PhotoService::getInstance()->findPhotoById($photoId);
     $album = PHOTO_BOL_PhotoAlbumService::getInstance()->findAlbumById($photo->albumId);
     $userId = OW::getUser()->getId();
     // photo id field
     $photoIdField = new HiddenField('id');
     $photoIdField->setRequired(true);
     $this->addElement($photoIdField);
     // photo album Field
     $albumField = new SuggestField('album');
     $responderUrl = OW::getRouter()->urlFor('PHOTO_CTRL_Upload', 'suggestAlbum', array('userId' => $userId));
     $albumField->setResponderUrl($responderUrl);
     if ($album) {
         $albumField->setValue($album->name);
     }
     $albumField->setRequired(true);
     $albumField->setLabel($language->text('photo', 'album'));
     $this->addElement($albumField);
     // description Field
     $descField = new WysiwygTextarea('description', null, false);
     $descField->setId("photo-desc-area");
     $this->addElement($descField->setLabel($language->text('photo', 'description')));
     $tags = array();
     $entityTags = BOL_TagService::getInstance()->findEntityTags($photo->id, 'photo');
     if ($entityTags) {
         $tags = array();
         foreach ($entityTags as $entityTag) {
             $tags[] = $entityTag->label;
         }
         $tagsField = new TagsInputField('tags');
         $tagsField->setValue($tags);
     } else {
         $tagsField = new TagsInputField('tags');
     }
     $this->addElement($tagsField->setLabel($language->text('photo', 'tags')));
     $submit = new Submit('edit');
     $submit->setValue($language->text('photo', 'btn_edit'));
     $this->addElement($submit);
 }
 public function __construct($name, $affiliateId = null)
 {
     parent::__construct($name);
     $this->setAction(OW::getRouter()->urlForRoute('ocsaffiliates.action_register_payout'));
     $this->setAjax(true);
     $lang = OW::getLanguage();
     $amount = new TextField('amount');
     $amount->setLabel($lang->text('ocsaffiliates', 'amount_paid'));
     $amount->setRequired(true);
     $this->addElement($amount);
     $affiliate = new HiddenField('affiliateId');
     $affiliate->setRequired(true);
     $this->addElement($affiliate);
     $byCredits = new CheckboxField('byCredits');
     $byCredits->setLabel($lang->text('ocsaffiliates', 'deposit_credits'));
     $this->addElement($byCredits);
     $submit = new Submit('add');
     $submit->setValue($lang->text('ocsaffiliates', 'register_btn'));
     $this->addElement($submit);
     $this->bindJsFunction(Form::BIND_SUCCESS, "function(data){\n            if ( !data.result ) {\n                OW.error(data.error);\n            }\n            else {\n                document.location.reload();\n            }\n        }");
 }
Exemple #13
0
 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        }");
 }
 public function __construct()
 {
     parent::__construct('set-membership-form');
     $this->setAjaxResetOnSuccess(false);
     $this->setAjax(true);
     $this->setAction(OW::getRouter()->urlForRoute('membership_set'));
     $lang = OW::getLanguage();
     $userId = new HiddenField('userId');
     $userId->setRequired(true);
     $this->addElement($userId);
     $types = new RadioGroupItemField('type');
     $types->setRequired(true);
     $types->setLabel($lang->text('membership', 'set_membership'));
     $this->addElement($types);
     $period = new TextField('period');
     $period->setLabel($lang->text('membership', 'set_period'));
     $this->addElement($period);
     $submit = new Submit('set');
     $submit->setValue($lang->text('membership', 'set'));
     $this->addElement($submit);
 }
Exemple #15
0
 /**
  * Class constructor
  */
 public function __construct($tpls)
 {
     parent::__construct('edit-template-form');
     $this->setAction(OW::getRouter()->urlFor('VIRTUALGIFTS_CTRL_Admin', 'editTemplate'));
     $single = count($tpls) == 1;
     $this->setEnctype('multipart/form-data');
     $language = OW::getLanguage();
     $giftService = VIRTUALGIFTS_BOL_VirtualGiftsService::getInstance();
     if ($single) {
         $file = new FileField('file');
         $file->setLabel($language->text('virtualgifts', 'gift_image'));
         $this->addElement($file);
         $tpl = $giftService->findTemplateById($tpls[0]);
     }
     $tplId = new HiddenField('tplId');
     $tplId->setRequired(true);
     $tplId->setValue(implode('|', $tpls));
     $this->addElement($tplId);
     if ($giftService->categoriesSetup()) {
         $categories = new Selectbox('category');
         $categories->setLabel($language->text('virtualgifts', 'category'));
         $categories->setOptions($giftService->getCategories());
         if ($single && isset($tpl)) {
             $categories->setValue($tpl->categoryId);
         }
         $this->addElement($categories);
     }
     if (OW::getPluginManager()->isPluginActive('usercredits')) {
         $price = new TextField('price');
         $price->setLabel($language->text('virtualgifts', 'gift_price'));
         if ($single && isset($tpl)) {
             $price->setValue($tpl->price);
         }
         $this->addElement($price);
     }
     // submit
     $submit = new Submit('save');
     $submit->setValue($language->text('virtualgifts', 'btn_save'));
     $this->addElement($submit);
 }
Exemple #16
0
 /**
  * Class constructor
  */
 public function __construct($clipId)
 {
     parent::__construct('videoEditForm');
     $this->setAjax(true);
     $this->setAction(OW::getRouter()->urlFor('GVIDEOVIEWER_CTRL_Index', 'ajaxUpdateVideo'));
     $language = OW::getLanguage();
     // clip id field
     $clipIdField = new HiddenField('id');
     $clipIdField->setRequired(true);
     $this->addElement($clipIdField);
     // title Field
     $titleField = new TextField('title');
     $titleField->addValidator(new StringValidator(1, 128));
     $titleField->setRequired(true);
     $this->addElement($titleField->setLabel($language->text('video', 'title')));
     // description Field
     $descField = new WysiwygTextarea('description');
     $descField->setId("video-desc-area");
     $this->addElement($descField->setLabel($language->text('video', 'description')));
     $code = new Textarea('code');
     $code->setRequired(true);
     $this->addElement($code->setLabel($language->text('video', 'code')));
     $entityTags = BOL_TagService::getInstance()->findEntityTags($clipId, 'video');
     if ($entityTags) {
         $tags = array();
         foreach ($entityTags as $entityTag) {
             $tags[] = $entityTag->label;
         }
         $tagsField = new TagsInputField('tags');
         $tagsField->setValue($tags);
     } else {
         $tagsField = new TagsInputField('tags');
     }
     $this->addElement($tagsField->setLabel($language->text('video', 'tags')));
     $submit = new Submit('edit');
     $submit->setValue($language->text('video', 'btn_edit'));
     $this->addElement($submit);
 }
    public function __construct()
    {
        parent::__construct('grant-credits-form');
        $this->setAjax(true);
        $this->setAjaxResetOnSuccess(false);
        $this->setAction(OW::getRouter()->urlFor('USERCREDITS_CTRL_Ajax', 'grantCredits'));
        $lang = OW::getLanguage();
        $userIdField = new HiddenField('userId');
        $userIdField->setRequired(true);
        $this->addElement($userIdField);
        $amount = new TextField('amount');
        $amount->setRequired(true);
        $this->addElement($amount);
        $submit = new Submit('grant');
        $submit->setValue($lang->text('usercredits', 'grant'));
        $this->addElement($submit);
        $js = 'owForms["' . $this->getName() . '"].bind("success", function(data){
            if ( data.error ) {
                OW.error(data.error);
                return;
            }

            if ( data.message ) {
                OW.info(data.message);
                _scope.floatBox && _scope.floatBox.close();
                
                if ( data.credits == "0" ) {
                    window.setTimeout(function(){
                        document.location.reload();
                    }, 600);

                    return;
                }
            }
        });';
        OW::getDocument()->addOnloadScript($js);
    }
Exemple #18
0
 /**
  * Class constructor
  */
 public function __construct($providerId)
 {
     parent::__construct('provider-edit-form');
     $this->setAjax(true);
     $this->bindJsFunction(Form::BIND_SUCCESS, 'function(data){if( data.result ){OW.info(data.message);setTimeout(function(){location.reload();}, 1000);}else{OW.error(data.message);}}');
     $this->setAction(OW::getRouter()->urlForRoute('yncontactimporter-admin-ajaxEditProvider'));
     $language = OW::getLanguage();
     $provider = YNCONTACTIMPORTER_BOL_ProviderService::getInstance()->findProviderById($providerId);
     // provider id field
     $providerIdField = new HiddenField('id');
     $providerIdField->setRequired(true);
     $this->addElement($providerIdField);
     // provider title
     $providerTitle = new TextField('title');
     $providerTitle->setLabel($language->text('yncontactimporter', 'provider_title'));
     $providerTitle->setRequired(true);
     $this->addElement($providerTitle);
     for ($i = 1; $i <= 10; $i++) {
         $option[$i] = $i;
     }
     // provider order
     $providerOrder = new Selectbox('order');
     $providerOrder->setLabel($language->text('yncontactimporter', 'order'));
     $providerOrder->addOptions($option);
     $providerOrder->setHasInvitation(false);
     $this->addElement($providerOrder);
     // provider enable
     $providerEnable = new Selectbox('enable');
     $providerEnable->setLabel($language->text('yncontactimporter', 'enabled_disabled'));
     $providerEnable->addOptions(array(1 => 'Enabled', 0 => 'Disabled'));
     $providerEnable->setHasInvitation(false);
     $this->addElement($providerEnable);
     $submit = new Submit('edit');
     $submit->setValue($language->text('yncontactimporter', 'save_btn_label'));
     $this->addElement($submit);
 }
Exemple #19
0
 /**
  * Class constructor
  *
  */
 public function __construct($clipId)
 {
     parent::__construct('vwlsEditForm');
     $language = OW::getLanguage();
     // clip id field
     $clipIdField = new HiddenField('id');
     $clipIdField->setRequired(true);
     $this->addElement($clipIdField);
     // select box for broadcasting
     $arr1 = array('1' => 'yes', '0' => 'no');
     $arr0 = array('0' => 'no', '1' => 'yes');
     // select box for permission
     $permArr0 = array('1' => 'moderators', '3' => 'none', '2' => 'owner', '0' => 'all');
     $permArr1 = array('0' => 'all', '3' => 'none', '2' => 'owner', '1' => 'moderators');
     $permArr2 = array('3' => 'none', '2' => 'owner', '1' => 'moderators', '0' => 'all');
     // room_name Field
     $generated = base_convert(time() - 1224000000 . rand(0, 10), 10, 36);
     $room_nameField = new TextField('room_name');
     $sValidator = new StringValidator(1, 22);
     $room_nameField->addValidator($sValidator);
     $room_nameField->setRequired(true);
     $room_nameField->setValue($generated);
     $this->addElement($room_nameField->setLabel($language->text('vwls', 'room_name')));
     // Description Field
     $descriptionField = new Textarea('description');
     $this->addElement($descriptionField->setLabel($language->text('vwls', 'description')));
     // Room limit Field
     $room_limitField = new TextField('room_limit');
     $room_limitField->setRequired(false);
     $room_limitField->setValue(0);
     $this->addElement($room_limitField->setLabel($language->text('vwls', 'room_limit')));
     // Show Camera Settings Field
     $show_camera_settingsField = new Selectbox('show_camera_settings');
     $show_camera_settingsField->addOptions($arr1);
     $show_camera_settingsField->setRequired();
     $show_camera_settingsField->setHasInvitation(false);
     $this->addElement($show_camera_settingsField->setLabel($language->text('vwls', 'show_camera_settings')));
     // Advanced Camera Settings Field
     $advanced_camera_settingsField = new Selectbox('advanced_camera_settings');
     $advanced_camera_settingsField->addOptions($arr1);
     $advanced_camera_settingsField->setRequired();
     $advanced_camera_settingsField->setHasInvitation(false);
     $this->addElement($advanced_camera_settingsField->setLabel($language->text('vwls', 'advanced_camera_settings')));
     // Configure Source Field
     $configure_sourceField = new Selectbox('configure_source');
     $configure_sourceField->addOptions($arr1);
     $configure_sourceField->setRequired();
     $configure_sourceField->setHasInvitation(false);
     $this->addElement($configure_sourceField->setLabel($language->text('vwls', 'configure_source')));
     // user_list Field
     $user_listField = new Textarea('user_list');
     $this->addElement($user_listField->setLabel($language->text('vwls', 'user_list')));
     // moderator_list Field
     $moderator_listField = new Textarea('moderator_list');
     $userService = BOL_UserService::getInstance();
     $user = $userService->findUserById(OW::getUser()->getId());
     $username = $user->getUsername();
     $moderator_listField->setValue($username);
     $this->addElement($moderator_listField->setLabel($language->text('vwls', 'moderator_list')));
     // administrator Field
     /**        $administratorField = new Selectbox('administrator');
             $administratorField->addOptions($permArr0);
             $administratorField->setRequired();
             $administratorField->setHasInvitation(false);
             $this->addElement($administratorField->setLabel($language->text('vwls', 'administrator')));
     */
     // clean_up Field
     $clean_upField = new TextField('clean_up');
     $clean_upField->setValue(0);
     $this->addElement($clean_upField->setLabel($language->text('vwls', 'clean_up')));
     // Broadcasting
     // welcome Field
     $welcomeField = new Textarea('welcome');
     $welcomeField->setValue($language->text('vwls', 'welcome_default'));
     $this->addElement($welcomeField->setLabel($language->text('vwls', 'welcome')));
     // Only video Field
     $only_videoField = new Selectbox('only_video');
     $only_videoField->addOptions($arr0);
     $only_videoField->setRequired();
     $only_videoField->setHasInvitation(false);
     $this->addElement($only_videoField->setLabel($language->text('vwls', 'only_video')));
     // No Video Field
     $no_videoField = new Selectbox('no_video');
     $no_videoField->addOptions($arr0);
     $no_videoField->setRequired();
     $no_videoField->setHasInvitation(false);
     $this->addElement($no_videoField->setLabel($language->text('vwls', 'no_video')));
     // No Embeds Field
     $no_embedsField = new Selectbox('no_embeds');
     $no_embedsField->addOptions($arr0);
     $no_embedsField->setRequired();
     $no_embedsField->setHasInvitation(false);
     $this->addElement($no_embedsField->setLabel($language->text('vwls', 'no_embeds')));
     // Show Timer Field
     $show_timerField = new Selectbox('show_timer');
     $show_timerField->addOptions($arr1);
     $show_timerField->setRequired();
     $show_timerField->setHasInvitation(false);
     $this->addElement($show_timerField->setLabel($language->text('vwls', 'show_timer')));
     // writeText Field
     $write_textField = new Selectbox('write_text');
     $write_textField->addOptions($arr1);
     $write_textField->setRequired();
     $write_textField->setHasInvitation(false);
     $this->addElement($write_textField->setLabel($language->text('vwls', 'write_text')));
     // resolution Field
     $resolutionArr = array('320x240' => '320x240', '160x120' => '160x120', '176x144' => '176x144', '352x288' => '352x288', '640x480' => '640x480');
     $resolutionField = new Selectbox('resolution');
     $resolutionField->addOptions($resolutionArr);
     $resolutionField->setRequired();
     $resolutionField->setHasInvitation(false);
     $this->addElement($resolutionField->setLabel($language->text('vwls', 'resolution')));
     // camera_fps Field
     $camera_fpsArr = array('10' => '10', '12' => '12', '20' => '20', '25' => '25', '30' => '30');
     $camera_fpsField = new Selectbox('camera_fps');
     $camera_fpsField->addOptions($camera_fpsArr);
     $camera_fpsField->setRequired();
     $camera_fpsField->setHasInvitation(false);
     $this->addElement($camera_fpsField->setLabel($language->text('vwls', 'camera_fps')));
     // Microphone Rate Field
     $microphone_rateArr = array('11' => '11', '22' => '22', '44' => '44', '48' => '48');
     $microphone_rateField = new Selectbox('microphone_rate');
     $microphone_rateField->addOptions($microphone_rateArr);
     $microphone_rateField->setRequired();
     $microphone_rateField->setHasInvitation(false);
     $this->addElement($microphone_rateField->setLabel($language->text('vwls', 'microphone_rate')));
     // soundQuality Field
     $soundQualityField = new TextField('soundQuality');
     $soundQualityField->setRequired(true);
     $this->addElement($soundQualityField->setLabel($language->text('vwls', 'soundQuality')));
     // Bandwidth Field
     $bandwidthField = new TextField('bandwidth');
     $bandwidthField->setRequired(true);
     $bandwidthField->setValue(40960);
     $this->addElement($bandwidthField->setLabel($language->text('vwls', 'bandwidth')));
     // FloodProtection Field
     $flood_protectionField = new TextField('flood_protection');
     $flood_protectionField->setValue(3);
     $this->addElement($flood_protectionField->setLabel($language->text('vwls', 'flood_protection')));
     // verbose_level Field
     $verbose_levelArr = array('2' => 'warning/recoverable failure', '0' => 'nothing', '1' => 'failure', '3' => 'success', '4' => 'action');
     $verbose_levelField = new Selectbox('verbose_level');
     $verbose_levelField->addOptions($verbose_levelArr);
     $verbose_levelField->setRequired();
     $verbose_levelField->setHasInvitation(false);
     $this->addElement($verbose_levelField->setLabel($language->text('vwls', 'verbose_level')));
     // Label Color Field
     $label_colorField = new TextField('label_color');
     $label_colorField->setValue('FFFFFF');
     $this->addElement($label_colorField->setLabel($language->text('vwls', 'label_color')));
     // privateTextchat Field
     $private_textchatField = new Selectbox('private_textchat');
     $private_textchatField->addOptions($arr1);
     $private_textchatField->setRequired();
     $private_textchatField->setHasInvitation(false);
     $this->addElement($private_textchatField->setLabel($language->text('vwls', 'private_textchat')));
     // Layout Code Field
     $layout_codeField = new Textarea('layout_code');
     $this->addElement($layout_codeField->setLabel($language->text('vwls', 'layout_code')));
     // Fill window Field
     $fill_windowField = new Selectbox('fill_window');
     $fill_windowField->addOptions($arr1);
     $fill_windowField->setRequired();
     $fill_windowField->setHasInvitation(false);
     $this->addElement($fill_windowField->setLabel($language->text('vwls', 'fill_window')));
     // Video / Watch
     // welcome Field
     $welcome2Field = new Textarea('welcome2');
     $welcome2Field->setValue($language->text('vwls', 'welcome_default2'));
     $this->addElement($welcome2Field->setLabel($language->text('vwls', 'welcome2')));
     // Offline message Field
     $offline_messageField = new Textarea('offline_message');
     $this->addElement($offline_messageField->setLabel($language->text('vwls', 'offline_message')));
     // FloodProtection2 Field
     $flood_protection2Field = new TextField('flood_protection2');
     $flood_protection2Field->setValue(3);
     $this->addElement($flood_protection2Field->setLabel($language->text('vwls', 'flood_protection2')));
     // Filter regex Field
     $filter_regexField = new TextField('filter_regex');
     $filter_regexField->setValue('(?i)(f**k|c**t)(?-i)');
     $this->addElement($filter_regexField->setLabel($language->text('vwls', 'filter_regex')));
     // Filter replace Field
     $filter_replaceField = new TextField('filter_replace');
     $filter_replaceField->setValue('**');
     $this->addElement($filter_replaceField->setLabel($language->text('vwls', 'filter_replace')));
     // Layout Code2 Field
     $layout_code2Field = new Textarea('layout_code2');
     $this->addElement($layout_code2Field->setLabel($language->text('vwls', 'layout_code2')));
     // Fill window2 Field
     $fill_window2Field = new Selectbox('fill_window2');
     $fill_window2Field->addOptions($permArr0);
     $fill_window2Field->setRequired();
     $fill_window2Field->setHasInvitation(false);
     $this->addElement($fill_window2Field->setLabel($language->text('vwls', 'fill_window2')));
     // writeText2 Field
     $write_text2Field = new Selectbox('write_text2');
     $write_text2Field->addOptions($permArr1);
     $write_text2Field->setRequired();
     $write_text2Field->setHasInvitation(false);
     $this->addElement($write_text2Field->setLabel($language->text('vwls', 'write_text2')));
     // Enable Video Field
     $enable_videoField = new Selectbox('enable_video');
     $enable_videoField->addOptions($permArr1);
     $enable_videoField->setRequired();
     $enable_videoField->setHasInvitation(false);
     $this->addElement($enable_videoField->setLabel($language->text('vwls', 'enable_video')));
     // Enable chat Field
     $enable_chatField = new Selectbox('enable_chat');
     $enable_chatField->addOptions($permArr1);
     $enable_chatField->setRequired();
     $enable_chatField->setHasInvitation(false);
     $this->addElement($enable_chatField->setLabel($language->text('vwls', 'enable_chat')));
     // Enable users Field
     $enable_usersField = new Selectbox('enable_users');
     $enable_usersField->addOptions($permArr1);
     $enable_usersField->setRequired();
     $enable_usersField->setHasInvitation(false);
     $this->addElement($enable_usersField->setLabel($language->text('vwls', 'enable_users')));
     $entityTags = BOL_TagService::getInstance()->findEntityTags($clipId, 'vwls');
     if ($entityTags) {
         $tags = array();
         foreach ($entityTags as $entityTag) {
             $tags[] = $entityTag->label;
         }
         $tagsField = new TagsField('tags', $tags);
     } else {
         $tagsField = new TagsField('tags');
     }
     $this->addElement($tagsField->setLabel($language->text('vwls', 'tags')));
     $submit = new Submit('edit');
     $submit->setValue($language->text('vwls', 'btn_edit'));
     $this->addElement($submit);
 }
Exemple #20
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct('albumEditForm');
     $language = OW::getLanguage();
     // album id field
     $albumIdField = new HiddenField('id');
     $albumIdField->setRequired(true);
     $this->addElement($albumIdField);
     // album name Field
     $albumNameField = new TextField('albumName');
     $this->addElement($albumNameField->setLabel($language->text('photo', 'album')));
     // category
     $categoryField = new Selectbox('category');
     $categories = array();
     foreach (ADVANCEDPHOTO_BOL_CategoryService::getInstance()->getCategoriesList() as $key => $item) {
         $categories[$item->id] = $item->name;
     }
     $categoryField->setOptions($categories);
     $this->addElement($categoryField->setLabel($language->text('advancedphoto', 'category')));
     $submit = new Submit('save');
     $submit->setValue($language->text('photo', 'btn_edit'));
     $this->addElement($submit);
 }
 /**
  * Generates Add Topic Form.
  *
  * @param array $groupSelect
  * @param int $groupId
  * @param $isHidden
  * @param $uid
  * @return Form
  */
 private function generateForm($groupSelect, $groupId, $isHidden, $uid)
 {
     $form = new Form('add-topic-form');
     $form->setEnctype("multipart/form-data");
     $lang = OW::getLanguage();
     $attachmentUid = new HiddenField('attachmentUid');
     $attachmentUid->setValue($uid);
     $attachmentUid->setRequired(true);
     $form->addElement($attachmentUid);
     $title = new TextField('title');
     $title->setRequired(true);
     $sValidator = new StringValidator(1, 255);
     $sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 255)));
     $title->addValidator($sValidator);
     $form->addElement($title);
     if ($isHidden) {
         $group = new HiddenField('group');
         $group->setValue($groupId);
     } else {
         $group = new ForumSelectBox('group');
         $group->setOptions($groupSelect);
         if ($groupId) {
             $group->setValue($groupId);
         }
         $group->setRequired(true);
         $group->addValidator(new IntValidator());
     }
     $form->addElement($group);
     $btnSet = array(BOL_TextFormatService::WS_BTN_IMAGE, BOL_TextFormatService::WS_BTN_VIDEO, BOL_TextFormatService::WS_BTN_HTML);
     $text = new WysiwygTextarea('text', $btnSet);
     $text->setRequired(true);
     $sValidator = new StringValidator(1, 50000);
     $sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 50000)));
     $text->addValidator($sValidator);
     $form->addElement($text);
     $subscribe = new CheckboxField('subscribe');
     $subscribe->setLabel($lang->text('forum', 'subscribe'));
     $subscribe->setValue(true);
     $form->addElement($subscribe);
     $post = new Submit('post');
     $post->setValue($lang->text('forum', 'add_post_btn'));
     $form->addElement($post);
     $this->addForm($form);
     return $form;
 }
Exemple #22
0
 /**
  * Class constructor
  *
  */
 public function __construct($clipId)
 {
     parent::__construct('vwvcEditForm');
     $language = OW::getLanguage();
     // clip id field
     $clipIdField = new HiddenField('id');
     $clipIdField->setRequired(true);
     $this->addElement($clipIdField);
     // select box for permission
     $permArr0 = array('1' => 'moderators', '3' => 'none', '2' => 'owner', '0' => 'all');
     $permArr1 = array('0' => 'all', '3' => 'none', '2' => 'owner', '1' => 'moderators');
     // room_name Field
     $room_nameField = new TextField('room_name');
     $sValidator = new StringValidator(1, 22);
     $room_nameField->addValidator($sValidator);
     $room_nameField->setRequired(true);
     $this->addElement($room_nameField->setLabel($language->text('vwvc', 'room_name')));
     // Description Field
     $descriptionField = new Textarea('description');
     $this->addElement($descriptionField->setLabel($language->text('vwvc', 'description')));
     // welcome Field
     $welcomeField = new Textarea('welcome');
     $welcomeField->setValue($language->text('vwvc', 'welcome_default'));
     $this->addElement($welcomeField->setLabel($language->text('vwvc', 'welcome')));
     // resolution Field
     $resolutionArr = array('320x240' => '320x240', '160x120' => '160x120', '176x144' => '176x144', '352x288' => '352x288', '640x480' => '640x480');
     $resolutionField = new Selectbox('resolution');
     $resolutionField->addOptions($resolutionArr);
     $resolutionField->setRequired();
     $resolutionField->setHasInvitation(false);
     $this->addElement($resolutionField->setLabel($language->text('vwvc', 'resolution')));
     // camera_fps Field
     $camera_fpsArr = array('10' => '10', '12' => '12', '20' => '20', '25' => '25', '30' => '30');
     $camera_fpsField = new Selectbox('camera_fps');
     $camera_fpsField->addOptions($camera_fpsArr);
     $camera_fpsField->setRequired();
     $camera_fpsField->setHasInvitation(false);
     $this->addElement($camera_fpsField->setLabel($language->text('vwvc', 'camera_fps')));
     // Microphone Rate Field
     $microphone_rateArr = array('11' => '11', '22' => '22', '44' => '44', '48' => '48');
     $microphone_rateField = new Selectbox('microphone_rate');
     $microphone_rateField->addOptions($microphone_rateArr);
     $microphone_rateField->setRequired();
     $microphone_rateField->setHasInvitation(false);
     $this->addElement($microphone_rateField->setLabel($language->text('vwvc', 'microphone_rate')));
     // soundQuality Field
     $soundQualityField = new TextField('soundQuality');
     $soundQualityField->setRequired(true);
     $this->addElement($soundQualityField->setLabel($language->text('vwvc', 'soundQuality')));
     // Bandwidth Field
     $bandwidthField = new TextField('bandwidth');
     $bandwidthField->setRequired(true);
     $bandwidthField->setValue(40960);
     $this->addElement($bandwidthField->setLabel($language->text('vwvc', 'bandwidth')));
     // verbose_level Field
     $verbose_levelArr = array('2' => 'warning/recoverable failure', '0' => 'nothing', '1' => 'failure', '3' => 'success', '4' => 'action');
     $verbose_levelField = new Selectbox('verbose_level');
     $verbose_levelField->addOptions($verbose_levelArr);
     $verbose_levelField->setRequired();
     $verbose_levelField->setHasInvitation(false);
     $this->addElement($verbose_levelField->setLabel($language->text('vwvc', 'verbose_level')));
     // Background url Field
     $background_urlField = new TextField('background_url');
     $this->addElement($background_urlField->setLabel($language->text('vwvc', 'background_url')));
     // Layout Code Field
     $layout_codeField = new Textarea('layout_code');
     $this->addElement($layout_codeField->setLabel($language->text('vwvc', 'layout_code')));
     // Fill window Field
     $fill_windowField = new Selectbox('fill_window');
     $fill_windowField->addOptions($permArr0);
     $fill_windowField->setRequired();
     $fill_windowField->setHasInvitation(false);
     $this->addElement($fill_windowField->setLabel($language->text('vwvc', 'fill_window')));
     // FloodProtection Field
     $flood_protectionField = new TextField('flood_protection');
     $flood_protectionField->setValue(3);
     $this->addElement($flood_protectionField->setLabel($language->text('vwvc', 'flood_protection')));
     // Filter regex Field
     $filter_regexField = new TextField('filter_regex');
     $filter_regexField->setValue('(?i)(f**k|c**t)(?-i)');
     $this->addElement($filter_regexField->setLabel($language->text('vwvc', 'filter_regex')));
     // Filter replace Field
     $filter_replaceField = new TextField('filter_replace');
     $filter_replaceField->setValue('**');
     $this->addElement($filter_replaceField->setLabel($language->text('vwvc', 'filter_replace')));
     // Show Camera Settings Field
     $show_camera_settingsField = new Selectbox('show_camera_settings');
     $show_camera_settingsField->addOptions($permArr1);
     $show_camera_settingsField->setRequired();
     $show_camera_settingsField->setHasInvitation(false);
     $this->addElement($show_camera_settingsField->setLabel($language->text('vwvc', 'show_camera_settings')));
     // Advanced Camera Settings Field
     $advanced_camera_settingsField = new Selectbox('advanced_camera_settings');
     $advanced_camera_settingsField->addOptions($permArr1);
     $advanced_camera_settingsField->setRequired();
     $advanced_camera_settingsField->setHasInvitation(false);
     $this->addElement($advanced_camera_settingsField->setLabel($language->text('vwvc', 'advanced_camera_settings')));
     // Configure Source Field
     $configure_sourceField = new Selectbox('configure_source');
     $configure_sourceField->addOptions($permArr1);
     $configure_sourceField->setRequired();
     $configure_sourceField->setHasInvitation(false);
     $this->addElement($configure_sourceField->setLabel($language->text('vwvc', 'configure_source')));
     // Disable Video Field
     $disable_videoField = new Selectbox('disable_video');
     $disable_videoField->addOptions($permArr1);
     $disable_videoField->setRequired();
     $disable_videoField->setHasInvitation(false);
     $this->addElement($disable_videoField->setLabel($language->text('vwvc', 'disable_video')));
     // disable_sound Field
     $disable_soundField = new Selectbox('disable_sound');
     $disable_soundField->addOptions($permArr1);
     $disable_soundField->setRequired();
     $disable_soundField->setHasInvitation(false);
     $this->addElement($disable_soundField->setLabel($language->text('vwvc', 'disable_sound')));
     // panel Files Field
     $panel_filesField = new Selectbox('panel_files');
     $panel_filesField->addOptions($permArr1);
     $panel_filesField->setRequired();
     $panel_filesField->setHasInvitation(false);
     $this->addElement($panel_filesField->setLabel($language->text('vwvc', 'panel_files')));
     // panel rooms Field
     $panel_roomsField = new Selectbox('panel_rooms');
     $panel_roomsField->addOptions($permArr1);
     $panel_roomsField->setRequired();
     $panel_roomsField->setHasInvitation(false);
     $this->addElement($panel_roomsField->setLabel($language->text('vwvc', 'panel_rooms')));
     // panel users Field
     $panel_usersField = new Selectbox('panel_users');
     $panel_usersField->addOptions($permArr1);
     $panel_usersField->setRequired();
     $panel_usersField->setHasInvitation(false);
     $this->addElement($panel_usersField->setLabel($language->text('vwvc', 'panel_users')));
     // File Upload Field
     $file_uploadField = new Selectbox('file_upload');
     $file_uploadField->addOptions($permArr1);
     $file_uploadField->setRequired();
     $file_uploadField->setHasInvitation(false);
     $this->addElement($file_uploadField->setLabel($language->text('vwvc', 'file_upload')));
     // file_delete Field
     $file_deleteField = new Selectbox('file_delete');
     $file_deleteField->addOptions($permArr0);
     $file_deleteField->setRequired();
     $file_deleteField->setHasInvitation(false);
     $this->addElement($file_deleteField->setLabel($language->text('vwvc', 'file_delete')));
     // Tutorial Field
     $tutorialField = new Selectbox('tutorial');
     $tutorialField->addOptions($permArr1);
     $tutorialField->setRequired();
     $tutorialField->setHasInvitation(false);
     $this->addElement($tutorialField->setLabel($language->text('vwvc', 'tutorial')));
     // Auto View Cameras Field
     $auto_view_camerasField = new Selectbox('auto_view_cameras');
     $auto_view_camerasField->addOptions($permArr1);
     $auto_view_camerasField->setRequired();
     $auto_view_camerasField->setHasInvitation(false);
     $this->addElement($auto_view_camerasField->setLabel($language->text('vwvc', 'auto_view_cameras')));
     // Show Timer Field
     $show_timerField = new Selectbox('show_timer');
     $show_timerField->addOptions($permArr1);
     $show_timerField->setRequired();
     $show_timerField->setHasInvitation(false);
     $this->addElement($show_timerField->setLabel($language->text('vwvc', 'show_timer')));
     // writeText Field
     $write_textField = new Selectbox('write_text');
     $write_textField->addOptions($permArr1);
     $write_textField->setRequired();
     $write_textField->setHasInvitation(false);
     $this->addElement($write_textField->setLabel($language->text('vwvc', 'write_text')));
     // regularWatch Field
     $regular_watchField = new Selectbox('regular_watch');
     $regular_watchField->addOptions($permArr1);
     $regular_watchField->setRequired();
     $regular_watchField->setHasInvitation(false);
     $this->addElement($regular_watchField->setLabel($language->text('vwvc', 'regular_watch')));
     // newWatch Field
     $new_watchField = new Selectbox('new_watch');
     $new_watchField->addOptions($permArr1);
     $new_watchField->setRequired();
     $new_watchField->setHasInvitation(false);
     $this->addElement($new_watchField->setLabel($language->text('vwvc', 'new_watch')));
     // privateTextchat Field
     $private_textchatField = new Selectbox('private_textchat');
     $private_textchatField->addOptions($permArr1);
     $private_textchatField->setRequired();
     $private_textchatField->setHasInvitation(false);
     $this->addElement($private_textchatField->setLabel($language->text('vwvc', 'private_textchat')));
     // user_list Field
     $user_listField = new Textarea('user_list');
     $this->addElement($user_listField->setLabel($language->text('vwvc', 'user_list')));
     // moderator_list Field
     $moderator_listField = new Textarea('moderator_list');
     $userService = BOL_UserService::getInstance();
     $user = $userService->findUserById(OW::getUser()->getId());
     $username = $user->getUsername();
     $moderator_listField->setValue($username);
     $this->addElement($moderator_listField->setLabel($language->text('vwvc', 'moderator_list')));
     // administrator Field
     $administratorField = new Selectbox('administrator');
     $administratorField->addOptions($permArr0);
     $administratorField->setRequired();
     $administratorField->setHasInvitation(false);
     $this->addElement($administratorField->setLabel($language->text('vwvc', 'administrator')));
     // clean_up Field
     $clean_upField = new TextField('clean_up');
     $clean_upField->setValue(0);
     $this->addElement($clean_upField->setLabel($language->text('vwvc', 'clean_up')));
     $entityTags = BOL_TagService::getInstance()->findEntityTags($clipId, 'vwvc');
     if ($entityTags) {
         $tags = array();
         foreach ($entityTags as $entityTag) {
             $tags[] = $entityTag->label;
         }
         $tagsField = new TagsField('tags', $tags);
     } else {
         $tagsField = new TagsField('tags');
     }
     $this->addElement($tagsField->setLabel($language->text('vwvc', 'tags')));
     $submit = new Submit('edit');
     $submit->setValue($language->text('vwvc', 'btn_edit'));
     $this->addElement($submit);
 }
Exemple #23
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct('albumEditForm');
     $language = OW::getLanguage();
     // album id field
     $albumIdField = new HiddenField('id');
     $albumIdField->setRequired(true);
     $this->addElement($albumIdField);
     // album name Field
     $albumNameField = new TextField('albumName');
     $this->addElement($albumNameField->setLabel($language->text('photo', 'album')));
     $submit = new Submit('save');
     $submit->setValue($language->text('photo', 'btn_edit'));
     $this->addElement($submit);
 }
Exemple #24
0
 public function __construct($assignedMemberships)
 {
     parent::__construct('add-membership-form');
     $this->assignedMemberships = $assignedMemberships;
     $lang = OW::getLanguage();
     $accTypeField = new HiddenField('accType');
     $accTypeField->setRequired(true);
     $this->addElement($accTypeField);
     $rolesField = new Selectbox('role');
     $roles = MEMBERSHIP_BOL_MembershipService::getInstance()->getRolesAvailableForMembership($this->assignedMemberships);
     $options = array();
     foreach ($roles as $role) {
         $options[$role->id] = $lang->text('base', 'authorization_role_' . $role->name);
     }
     if (count($options)) {
         $rolesField->setOptions($options);
     }
     $rolesField->setRequired(true)->setLabel($lang->text('membership', 'select_role'));
     $this->addElement($rolesField);
     $periodField = new TextField('period');
     $periodField->setRequired(true);
     $periodField->addValidator(new IntValidator(1, 100000));
     $this->addElement($periodField);
     $priceField = new TextField('price');
     $priceField->setRequired(true);
     $priceField->addValidator(new FloatValidator(0, 1000000));
     $this->addElement($priceField);
     $recurringField = new CheckboxField('isRecurring');
     $this->addElement($recurringField);
     // submit
     $submit = new Submit('save');
     $submit->setValue($lang->text('membership', 'add_btn'));
     $this->addElement($submit);
 }
Exemple #25
0
 public function __construct($typeId)
 {
     parent::__construct('edit-membership-form');
     $lang = OW::getLanguage();
     $typeField = new HiddenField('type');
     $typeField->setValue($typeId);
     $typeField->setRequired(true);
     $this->addElement($typeField);
     $type = MEMBERSHIP_BOL_MembershipService::getInstance()->findTypeById($typeId);
     $rolesField = new Selectbox('role');
     $roles = MEMBERSHIP_BOL_MembershipService::getInstance()->getRolesAvailableForMembership();
     foreach ($roles as $role) {
         $options[$role->id] = $lang->text('base', 'authorization_role_' . $role->name);
     }
     if (count($options)) {
         $rolesField->setOptions($options);
     }
     $rolesField->setRequired(true)->setValue($type->roleId)->setLabel($lang->text('membership', 'select_role'));
     $this->addElement($rolesField);
     // submit
     $submit = new Submit('update');
     $submit->setValue($lang->text('admin', 'save_btn_label'));
     $this->addElement($submit);
 }
Exemple #26
0
 public function __construct($videoId)
 {
     parent::__construct('videoEditForm');
     $language = OW::getLanguage();
     $videoIdField = new HiddenField('id');
     $videoIdField->setRequired(true);
     $this->addElement($videoIdField);
     $titleField = new TextField('name');
     $titleField->addValidator(new StringValidator(1, 128));
     $titleField->setRequired(true);
     $this->addElement($titleField->setLabel($language->text('ivideo', 'upload_video_name')));
     $descField = new WysiwygTextarea('description');
     $this->addElement($descField->setLabel($language->text('ivideo', 'upload_video_desc')));
     $element = new Selectbox('category');
     $element->setRequired(true);
     $element->setLabel($language->text('ivideo', 'admin_video_category'));
     foreach (IVIDEO_BOL_CategoryDao::getInstance()->findAll() as $category) {
         $element->addOption($category->id, $category->name);
     }
     $this->addElement($element);
     $entityTags = BOL_TagService::getInstance()->findEntityTags($videoId, 'ivideo-video');
     if ($entityTags) {
         $tags = array();
         foreach ($entityTags as $entityTag) {
             $tags[] = $entityTag->label;
         }
         $tagsField = new TagsField('tags', $tags);
     } else {
         $tagsField = new TagsField('tags');
     }
     $this->addElement($tagsField->setLabel($language->text('ivideo', 'tags_field_label')));
     $submit = new Submit('edit');
     $submit->setValue($language->text('ivideo', 'button_edit_label'));
     $this->addElement($submit);
 }
 /**
  * Generates edit topic form.
  *
  * @param $topicDto
  * @param $postDto
  * @param $uid
  * @return Form
  */
 private function generateEditTopicForm($topicDto, $postDto, $uid)
 {
     $form = new Form('edit-topic-form');
     $form->setEnctype('multipart/form-data');
     $lang = OW::getLanguage();
     $topicIdField = new HiddenField('topic-id');
     $topicIdField->setValue($topicDto->id);
     $form->addElement($topicIdField);
     $postIdField = new HiddenField('post-id');
     $postIdField->setValue($postDto->id);
     $form->addElement($postIdField);
     $attachmentUid = new HiddenField('attachmentUid');
     $attachmentUid->setValue($uid);
     $attachmentUid->setRequired(true);
     $form->addElement($attachmentUid);
     $topicTitleField = new TextField('title');
     $topicTitleField->setValue($topicDto->title);
     $topicTitleField->setRequired(true);
     $sValidator = new StringValidator(1, 255);
     $sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 255)));
     $topicTitleField->addValidator($sValidator);
     $form->addElement($topicTitleField);
     $btnSet = array(BOL_TextFormatService::WS_BTN_IMAGE, BOL_TextFormatService::WS_BTN_VIDEO, BOL_TextFormatService::WS_BTN_HTML);
     $postText = new WysiwygTextarea('text', $btnSet);
     $postText->setValue($postDto->text);
     $postText->setRequired(true);
     $sValidator = new StringValidator(1, 50000);
     $sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 50000)));
     $postText->addValidator($sValidator);
     $form->addElement($postText);
     $submit = new Submit('save');
     $submit->setValue($lang->text('base', 'edit_button'));
     $form->addElement($submit);
     return $form;
 }
Exemple #28
0
 /**
  * Generates add post form.
  *
  * @param int $topicId
  * @param string $uid
  * @return Form
  */
 private function generateAddPostForm($topicId, $uid)
 {
     $form = new Form('add-post-form');
     $form->setEnctype('multipart/form-data');
     $lang = OW::getLanguage();
     $addPostUrl = OW::getRouter()->urlForRoute('add-post', array('topicId' => $topicId, 'uid' => $uid));
     $form->setAction($addPostUrl);
     $topicIdField = new HiddenField('topic');
     $topicIdField->setValue($topicId);
     $form->addElement($topicIdField);
     $attachmentUid = new HiddenField('attachmentUid');
     $attachmentUid->setValue($uid);
     $attachmentUid->setRequired(true);
     $form->addElement($attachmentUid);
     $btnSet = array(BOL_TextFormatService::WS_BTN_IMAGE, BOL_TextFormatService::WS_BTN_VIDEO, BOL_TextFormatService::WS_BTN_HTML);
     $postText = new WysiwygTextarea('text', $btnSet);
     $postText->setRequired(true);
     $sValidator = new StringValidator(1, 50000);
     $sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 50000)));
     $postText->addValidator($sValidator);
     $form->addElement($postText);
     $submit = new Submit('submit');
     $submit->setValue($lang->text('forum', 'add_post_btn'));
     $form->addElement($submit);
     return $form;
 }
Exemple #29
0
 /**
  * Generates edit group form
  * 
  * @param string $action
  * @return Form
  */
 private function generateEditGroupForm($action)
 {
     $form = new Form('edit-group-form');
     $form->setAction($action);
     $lang = OW::getLanguage();
     $groupName = new TextField('group-name');
     $groupName->setRequired(true);
     $sValidator = new StringValidator(1, 255);
     $sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 255)));
     $groupName->addValidator($sValidator);
     $form->addElement($groupName);
     $description = new Textarea('description');
     $description->setRequired(true);
     $sValidator = new StringValidator(1, 50000);
     $sValidator->setErrorMessage($lang->text('forum', 'chars_limit_exceeded', array('limit' => 50000)));
     $description->addValidator($sValidator);
     $form->addElement($description);
     $groupId = new HiddenField('group-id');
     $groupId->setRequired(true);
     $form->addElement($groupId);
     $isPrivate = new CheckboxField('is-private');
     $form->addElement($isPrivate);
     $roles = new CheckboxGroup('roles');
     $authService = BOL_AuthorizationService::getInstance();
     $roleList = $authService->getRoleList();
     $options = array();
     foreach ($roleList as $role) {
         $options[$role->id] = $authService->getRoleLabel($role->name);
     }
     $roles->addOptions($options);
     $roles->setColumnCount(2);
     $form->addElement($roles);
     $submit = new Submit('save');
     $submit->setValue($lang->text('forum', 'edit_group_btn'));
     $form->addElement($submit);
     $form->setAjax(true);
     return $form;
 }
Exemple #30
0
 public function __construct($templateId, $users)
 {
     parent::__construct('confirm-gift-form');
     $lang = OW::getLanguage();
     $this->setAjax(true);
     $this->setAction(OW::getRouter()->urlFor('VIRTUALGIFTS_CTRL_Gifts', 'ajaxSendGifts'));
     $tplId = new HiddenField('tplId');
     $tplId->setRequired(true);
     $tplId->setValue($templateId);
     $this->addElement($tplId);
     $message = new Textarea('message');
     $this->addElement($message);
     $userIdList = new HiddenField('userIdList');
     $userIdList->setValue($users);
     $this->addElement($userIdList);
     $isPrivate = new CheckboxField('isPrivate');
     $isPrivate->setLabel($lang->text('virtualgifts', 'send_private'));
     $this->addElement($isPrivate);
     $submit = new Submit('send');
     $submit->setLabel($lang->text('virtualgifts', 'btn_send'));
     $this->addElement($submit);
     $js = 'owForms["' . $this->getName() . '"].bind("success", function(data){
         if ( data.error != undefined ){
             OW.error(data.error);
         }
         if ( data.message != undefined ){
             OW.info(data.message);
         }
         giftConfirmFloatBox.close()
     });';
     OW::getDocument()->addOnloadScript($js);
 }