public static function display()
 {
     if (isset($_POST['submit_module'])) {
         if (\PFBC\Form::isValid($_POST['submit_module'])) {
             new DisableModuleFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oModuleData = (new ModuleModel())->get();
     $aModuleNames = [];
     $aSelectedMods = [];
     foreach ($oModuleData as $oId) {
         if ((int) $oId->enabled === 1) {
             $aSelectedMods[] = $oId->moduleId;
         }
         $aModuleNames[$oId->moduleId] = ucwords(str_replace(['-', '_'], ' ', $oId->folderName));
     }
     $oForm = new \PFBC\Form('form_module');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_module', 'form_module'));
     $oForm->addElement(new \PFBC\Element\Token('module'));
     $oForm->addElement(new \PFBC\Element\Checkbox('', 'module_id', $aModuleNames, array('value' => $aSelectedMods)));
     $oForm->addElement(new \PFBC\Element\Button(t('Save')));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_module'])) {
         if (\PFBC\Form::isValid($_POST['submit_module'])) {
             new DisableModuleFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oModuleData = (new ModuleModel())->get();
     $aModuleNames = [];
     $aSelectedMods = [];
     foreach ($oModuleData as $oData) {
         if ((int) $oData->enabled === 1) {
             $aSelectedMods[] = $oData->moduleId;
         }
         $sPremiumText = '';
         if ((int) $oData->premiumMod === 1) {
             $sPremiumText = ' &nbsp; (<a class="italic darkred" href="' . Core::SOFTWARE_LICENSE_KEY_URL . '">' . t('Premium Module') . '</a>)';
         }
         $aModuleNames[$oData->moduleId] = ucwords(str_replace(['-', '_'], ' ', $oData->folderName)) . $sPremiumText;
     }
     unset($oModuleData);
     $oForm = new \PFBC\Form('form_module');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_module', 'form_module'));
     $oForm->addElement(new \PFBC\Element\Token('module'));
     $oForm->addElement(new \PFBC\Element\Checkbox('', 'module_id', $aModuleNames, array('value' => $aSelectedMods)));
     $oForm->addElement(new \PFBC\Element\Button(t('Save')));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_msg'])) {
         if (\PFBC\Form::isValid($_POST['submit_msg'])) {
             new MsgFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oForumsId = (new ForumModel())->getForum();
     $aForumsName = array();
     foreach ($oForumsId as $oId) {
         $aForumsName[$oId->forumId] = $oId->name;
     }
     $sTitlePattern = Config::getInstance()->values['module.setting']['url_title.pattern'];
     $oForm = new \PFBC\Form('form_msg', '100%');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_msg', 'form_msg'));
     $oForm->addElement(new \PFBC\Element\Token('msg'));
     $oForm->addElement(new \PFBC\Element\Select(t('Forum:'), 'forum', $aForumsName, array('value' => (new Http())->get('forum_id'))));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Subject:'), 'title', array('id' => 'str_title', 'onblur' => 'CValid(this.value,this.id,2,60)', 'pattern' => $sTitlePattern, 'required' => 1, 'validation' => new \PFBC\Validation\RegExp($sTitlePattern))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_title"></span>'));
     $oForm->addElement(new \PFBC\Element\CKEditor(t('Message:'), 'message', array('required' => 1, 'validation' => new \PFBC\Validation\Str(4))));
     if (DbConfig::getSetting('isCaptchaForum')) {
         $oForm->addElement(new \PFBC\Element\CCaptcha(t('Captcha:'), 'captcha', array('id' => 'ccaptcha', 'onkeyup' => 'CValid(this.value, this.id)', 'description' => t('Enter the code above:'))));
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error ccaptcha"></span>'));
     }
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script>'));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_game'])) {
         if (\PFBC\Form::isValid($_POST['submit_game'])) {
             new AdminFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oCategoriesData = (new GameModel())->getCategory(null, 0, 500);
     $aCategoriesName = array();
     foreach ($oCategoriesData as $oId) {
         $aCategoriesName[$oId->categoryId] = $oId->name;
     }
     unset($oCategoriesData);
     $sTitlePattern = Config::getInstance()->values['module.setting']['url_title.pattern'];
     $oForm = new \PFBC\Form('form_game');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_game', 'form_game'));
     $oForm->addElement(new \PFBC\Element\Token('game'));
     $oForm->addElement(new \PFBC\Element\Select(t('Category Name:'), 'category_id', $aCategoriesName, array('required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Name of the Game:'), 'name', array('pattern' => $sTitlePattern, 'validation' => new \PFBC\Validation\RegExp($sTitlePattern), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Title of the Game:'), 'title', array('validation' => new \PFBC\Validation\Str(2, 120), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Description:'), 'description', array('validation' => new \PFBC\Validation\Str(2, 255), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Keywords:'), 'keywords', array('validation' => new \PFBC\Validation\Str(2, 255), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\File(t('Thumbnail of the Game:'), 'thumb', array('accept' => 'image/*', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\File(t('File of the Game:'), 'file', array('accept' => 'application/x-shockwave-flash', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_admin_edit_account'])) {
         if (\PFBC\Form::isValid($_POST['submit_admin_edit_account'])) {
             new EditFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oHR = new Http();
     // Prohibit other administrators to edit the Root Administrator (ID 1)
     $iProfileId = $oHR->getExists('profile_id') && $oHR->get('profile_id', 'int') !== 1 ? $oHR->get('profile_id', 'int') : (new Session())->get('admin_id');
     $oAdmin = (new AdminModel())->readProfile($iProfileId, 'Admins');
     $oForm = new \PFBC\Form('form_admin_edit_account', 500);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_admin_edit_account', 'form_admin_edit_account'));
     $oForm->addElement(new \PFBC\Element\Token('edit_account'));
     if ($oHR->getExists('profile_id') && $oHR->get('profile_id', 'int') !== 1) {
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<p class="center"><a class="s_button" href="' . Uri::get(PH7_ADMIN_MOD, 'admin', 'browse') . '">' . t('Return to back admins browse') . '</a></p>'));
     }
     unset($oHR);
     $oForm->addElement(new \PFBC\Element\Textbox(t('Username:'******'username', array('value' => $oAdmin->username, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Email(t('Login Email:'), 'mail', array('value' => $oAdmin->email, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('First Name:'), 'first_name', array('value' => $oAdmin->firstName, 'required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Last Name:'), 'last_name', array('value' => $oAdmin->lastName, 'required' => 1, 'validation' => new \PFBC\Validation\Str(2, 20))));
     $oForm->addElement(new \PFBC\Element\Radio(t('Sex:'), 'sex', array('male' => t('Male'), 'female' => t('Female')), array('value' => $oAdmin->sex, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Timezone('Time Zone:', 'time_zone', array('value' => $oAdmin->timeZone, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
 /**
  * Embed code
  *
  * @param string $sFileUrl
  * @param integer $iEmbedWidth Width of the embed code. Default: 580
  * @param integer $iEmbedHeight Height of the embed code. Default: 450
  * @param integer $iWidth Width of the form. Default: 350
  * @return void
  */
 public static function display($sFileUrl, $iEmbedWidth = 580, $iEmbedHeight = 450, $iWidth = 350)
 {
     $sEmbedCode = '<object codebase="http://www.adobe.com/go/getflashplayer" width="' . $iEmbedWidth . '" height="' . $iEmbedHeight . '" align="middle"><param name="movie" value="' . $sFileUrl . '" /><param name="quality" value="high" /><embed src="' . $sFileUrl . '" width="' . $iEmbedWidth . '" height="' . $iEmbedHeight . '" align="middle" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
     $oForm = new \PFBC\Form('form_share_embed', $iWidth);
     $oForm->configure(array('class' => 'center'));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Embed Code'), 'embed', array('value' => $sEmbedCode, 'readonly' => 'readonly', 'onclick' => 'this.select()')));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<br />'));
     $oForm->render();
 }
 /**
  * @param $sUrl The URL to share. If you enter nothing, it will be the current URL. Default: NULL
  * @param integer $iWidth Default: 350
  * @return void
  */
 public static function display($sUrl = null, $iWidth = 350)
 {
     $sUrl = !empty($sUrl) ? $sUrl : (new Http())->currentUrl();
     $oForm = new \PFBC\Form('form_share_url', $iWidth);
     $oForm->configure(array('class' => 'center'));
     $oForm->addElement(new \PFBC\Element\Url(t('Share URL:'), 'share', array('value' => $sUrl, 'readonly' => 'readonly', 'onclick' => 'this.select()')));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<br />'));
     $oForm->render();
 }
 public static function display()
 {
     $oForm = new \PFBC\Form('form_search', 500);
     $oForm->configure(array('action' => Uri::get('forum', 'forum', 'result') . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Search(t('Name, Keyword of message, Author (username) or ID of Topic Forum:'), 'looking'));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::TITLE => t('Title'), SearchCoreModel::VIEWS => t('Popular'), SearchCoreModel::CREATED => t('Created Date'), SearchCoreModel::UPDATED => t('Updated Date'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::ASC => t('Ascending'), SearchCoreModel::DESC => t('Descending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->render();
 }
 public static function display($iWidth = 500)
 {
     $oForm = new \PFBC\Form('form_search', $iWidth);
     $oForm->configure(array('action' => Uri::get('game', 'main', 'result') . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Search(t('Search Games'), 'looking', array('title' => t('Enter Name, Description, Keyword or ID of a Game.'), 'style' => 'width:' . $iWidth * 1.1 . 'px')));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::TITLE => t('Title'), SearchCoreModel::VIEWS => t('Popular'), SearchCoreModel::RATING => t('Rated'), SearchCoreModel::DOWNLOADS => t('Downloaded'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::ASC => t('Ascending'), SearchCoreModel::DESC => t('Descending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->render();
 }
 public static function display()
 {
     $oForm = new \PFBC\Form('form_search', 500);
     $oForm->configure(array('action' => Uri::get('newsletter', 'admin', 'browse') . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Search(t('Search an Subscriber:'), 'looking', array('description' => t('Enter their ID, Name, Email or IP address.'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::EMAIL => t('Email'), SearchCoreModel::NAME => t('Name'), SearchCoreModel::LATEST => t('Latest'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::ASC => t('Ascending'), SearchCoreModel::DESC => t('Descending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->render();
 }
 public static function display($iWidth = 500)
 {
     $oForm = new \PFBC\Form('form_search', $iWidth);
     $oForm->configure(array('action' => Uri::get('blog', 'main', 'result') . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Search(t('Name, Keyword of post, or ID of Blog Post:'), 'looking', array('style' => 'width:' . $iWidth * 1.1 . 'px')));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::TITLE => t('Title'), SearchCoreModel::VIEWS => t('Popular'), SearchCoreModel::RATING => t('Rated'), SearchCoreModel::CREATED => t('Created Date'), SearchCoreModel::UPDATED => t('Updated Date'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::ASC => t('Ascending'), SearchCoreModel::DESC => t('Descending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->render();
 }
 public static function display()
 {
     $oForm = new \PFBC\Form('form_search', 500);
     $oForm->configure(array('action' => Uri::get('picture', 'main', 'result') . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Search(t('ID or Name of Picture:'), 'looking'));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::TITLE => t('Title'), SearchCoreModel::VIEWS => t('Popular'), SearchCoreModel::RATING => t('Rated'), SearchCoreModel::CREATED => t('Created Date'), SearchCoreModel::UPDATED => t('Updated Date'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::ASC => t('Ascending'), SearchCoreModel::DESC => t('Descending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->render();
 }
 public static function display()
 {
     $oForm = new \PFBC\Form('form_admin_search', 500);
     $oForm->configure(array('action' => Uri::get(PH7_ADMIN_MOD, 'admin', 'browse') . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Search(t('Search an Admin:'), 'looking', array('description' => t('Enter their ID, First Name, Last Name, Username, Email, Sex or IP address.'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::USERNAME => t('Username'), SearchCoreModel::FIRST_NAME => t('First Name'), SearchCoreModel::LAST_NAME => t('Last Name'), SearchCoreModel::EMAIL => t('Email'), SearchCoreModel::LATEST => t('Latest Admins'), SearchCoreModel::LAST_ACTIVITY => t('Last Activity'), SearchCoreModel::LAST_EDIT => t('Last Account Edit'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::ASC => t('Ascending'), SearchCoreModel::DESC => t('Descending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_forum'])) {
         if (\PFBC\Form::isValid($_POST['submit_forum'])) {
             new ForumFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oCategoriesData = (new ForumModel())->getCategory();
     $aCategoriesName = array();
     foreach ($oCategoriesData as $oId) {
         $aCategoriesName[$oId->categoryId] = $oId->title;
     }
     unset($oCategoriesData);
     $sTitlePattern = Config::getInstance()->values['module.setting']['url_title.pattern'];
     $oForm = new \PFBC\Form('form_forum', '100%');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_forum', 'form_forum'));
     $oForm->addElement(new \PFBC\Element\Token('forum'));
     $oForm->addElement(new \PFBC\Element\Select(t('Category Name:'), 'category_id', $aCategoriesName, array('value' => (new Http())->get('category_id'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Forum Name:'), 'name', array('id' => 'str_name', 'onblur' => 'CValid(this.value,this.id,2,60)', 'pattern' => $sTitlePattern, 'required' => 1, 'validation' => new \PFBC\Validation\RegExp($sTitlePattern))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_name"></span>'));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Description:'), 'description', array('id' => 'str_description', 'required' => 1, 'onblur' => 'CValid(this.value,this.id,4,255)', 'validation' => new \PFBC\Validation\Str(4, 255))));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error str_description"></span>'));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script>'));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_membership'])) {
         if (\PFBC\Form::isValid($_POST['submit_membership'])) {
             new MembershipFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_membership', 600);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_membership', 'form_membership'));
     $oForm->addElement(new \PFBC\Element\Token('membership'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Name:'), 'name', array('required' => 1, 'validation' => new \PFBC\Validation\Str(2, 64))));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Description:'), 'description', array('required' => 1, 'validation' => new \PFBC\Validation\Str(5, 255))));
     $aPerms = (include dirname(__DIR__) . PH7_DS . PH7_CONFIG . 'perms.inc.php');
     foreach ($aPerms as $sKey => $sVal) {
         $sLabel = (new Str())->upperFirstWords(str_replace('_', ' ', $sKey));
         $oForm->addElement(new \PFBC\Element\Select($sLabel, 'perms[' . $sKey . ']', array(1 => t('Yes'), 0 => t('No')), array('value' => $sVal)));
     }
     unset($aPerms);
     $oForm->addElement(new \PFBC\Element\Number(t('Price:'), 'price', array('description' => t('Currency: %0%. 0 = Free. To change the currency, please <a href="%1%">go to settings</a>.', Config::getInstance()->values['module.setting']['currency'], Uri::get('payment', 'admin', 'config')), 'step' => '0.01', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Number(t('Expiration Days:'), 'expiration_days', array('description' => t('0 = Unlimited'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Radio(t('Active:'), 'enable', array(1 => t('Enabled'), 0 => t('Disabled')), array('value' => 1, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Button(t('Add')));
     $oForm->render();
 }
Exemple #16
0
 public static function display()
 {
     if (isset($_POST['submit_picture'])) {
         if (\PFBC\Form::isValid($_POST['submit_picture'])) {
             new PictureFormProcess();
         }
         Framework\Url\HeaderUrl::redirect();
     }
     $oHttpRequest = new Http();
     $iAlbumIdVal = $oHttpRequest->getExists('album_id') ? $oHttpRequest->get('album_id') : null;
     // Album ID Value
     unset($oHttpRequest);
     $oAlbumId = (new PictureModel())->getAlbumsName((new Session())->get('member_id'));
     $aAlbumName = array();
     foreach ($oAlbumId as $iId) {
         $aAlbumName[$iId->albumId] = $iId->name;
     }
     $oForm = new \PFBC\Form('form_picture', 500);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_picture', 'form_picture'));
     $oForm->addElement(new \PFBC\Element\Token('picture'));
     $oForm->addElement(new \PFBC\Element\Select(t('Choose your album - OR - <a href="%0%">Add a new Album</a>', Uri::get('picture', 'main', 'addalbum')), 'album_id', $aAlbumName, array('value' => $iAlbumIdVal, 'required' => 1)));
     unset($aAlbumName);
     $oForm->addElement(new \PFBC\Element\Hidden('album_title', @$iId->name));
     // Bad title! Thank you for finding a solution and send it by email
     $oForm->addElement(new \PFBC\Element\Textbox(t('Name of your photo(s):'), 'title', array('validation' => new \PFBC\Validation\Str(2, 40))));
     $oForm->addElement(new \PFBC\Element\File(t('Your picture(s)'), 'photos[]', array('description' => '<span class="bold">' . t('Tip:') . '</span> ' . t('You can select multiple photos at once by clicking multiple files while holding down the "CTRL" key.'), 'multiple' => 'multiple', 'accept' => 'image/*', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<p class="pfbc-label"><em><span class="bold">' . t('Note:') . '</span> ' . t('Please be patient while downloading pictures, this may take time (especially if you download a lot of photos at once).') . '</em></p>'));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Description of your photo:'), 'description', array('validation' => new \PFBC\Validation\Str(2, 200))));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_edit_membership'])) {
         if (\PFBC\Form::isValid($_POST['submit_edit_membership'])) {
             new EditMembershipFormProcess();
         }
         Framework\Url\HeaderUrl::redirect();
     }
     $oMembership = (new PaymentModel())->getMemberships((new Http())->get('group_id', 'int'));
     $oForm = new \PFBC\Form('form_edit_membership', 600);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_edit_membership', 'form_edit_membership'));
     $oForm->addElement(new \PFBC\Element\Token('membership'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Name:'), 'name', array('value' => $oMembership->name, 'required' => 1, 'validation' => new \PFBC\Validation\Str(2, 64))));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Description:'), 'description', array('value' => $oMembership->description, 'required' => 1, 'validation' => new \PFBC\Validation\Str(5, 255))));
     $aDefPerms = (include dirname(__DIR__) . '/config/perms.inc.php');
     $aDbPerms = unserialize($oMembership->permissions);
     $aPerms = array_merge($aDefPerms, $aDbPerms);
     // Update new permissions from perms.inc.php file
     foreach ($aPerms as $sKey => $sVal) {
         $sLabel = (new Str())->upperFirstWords(str_replace('_', ' ', $sKey));
         $oForm->addElement(new \PFBC\Element\Select($sLabel, 'perms[' . $sKey . ']', array(1 => t('Yes'), 0 => t('No')), array('value' => $sVal)));
     }
     unset($aPerms);
     $oForm->addElement(new \PFBC\Element\Number(t('Price:'), 'price', array('description' => t('Currency: %0%. 0 = Free. To change the currency, please <a href="%1%">go to settings</a>.', Config::getInstance()->values['module.setting']['currency'], Uri::get('payment', 'admin', 'config')), 'value' => $oMembership->price, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Number(t('Expiration Days:'), 'expiration_days', array('description' => t('0 = Unlimited'), 'value' => $oMembership->expirationDays, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Radio(t('Active:'), 'enable', array(1 => t('Enabled'), 0 => t('Disabled')), array('value' => $oMembership->enable, 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Button(t('Update')));
     $oForm->render();
 }
 public static function display()
 {
     $sUsername = (new Http())->get('username');
     $oForm = new \PFBC\Form('form_search', 500);
     $oForm->configure(array('action' => Uri::get('user', 'visitor', 'index', $sUsername) . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Search(t('Find Search a Visitor of "%0%"', $sUsername), 'looking', array('title' => t('Enter its First Name, Last Name, Username, Email address or ID of your Friend.'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::LAST_VISIT => t('Last Seen on your profile'), SearchCoreModel::USERNAME => t('Username'), SearchCoreModel::FIRST_NAME => t('First Name'), SearchCoreModel::LAST_NAME => t('Last Name'), SearchCoreModel::EMAIL => t('Email'), SearchCoreModel::LATEST => t('Latest'), SearchCoreModel::LAST_ACTIVITY => t('Last Activity'), SearchCoreModel::VIEWS => t('Popular'), SearchCoreModel::RATING => t('Rated'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::DESC => t('Descending'), SearchCoreModel::ASC => t('Ascending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->render();
 }
 /**
  * @param string $sLabel Link name of submit form
  * @param string $sModule
  * @param string $sController
  * @param string $sAction
  * @param array $aParams The parameters
  * @return void
  */
 public static function display($sLabel, $sModule, $sController, $sAction, array $aParams)
 {
     $sUrl = !isset($sModule, $sController, $sAction) ? (new Http())->currentUrl() : Uri::get($sModule, $sController, $sAction);
     $oForm = new \PFBC\Form('form_link');
     $oForm->configure(array('action' => $sUrl, 'class' => 'form_link'));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_link', 'form_link'));
     $oForm->addElement(new \PFBC\Element\Token(substr($sUrl, -14, -6)));
     // Create a name token and generate a random token
     foreach ($aParams as $sKey => $sVal) {
         $oForm->addElement(new \PFBC\Element\Hidden($sKey, $sVal));
     }
     $oForm->addElement(new \PFBC\Element\Submit($sLabel));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_bank_account'])) {
         if (\PFBC\Form::isValid($_POST['submit_bank_account'])) {
             new BankFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oHR = new Http();
     $iProfileId = AdminCore::auth() && !Affiliate::auth() && $oHR->getExists('profile_id') ? $oHR->get('profile_id', 'int') : (new Session())->get('affiliate_id');
     $oAff = (new AffiliateModel())->readProfile($iProfileId, 'Affiliates');
     $oForm = new \PFBC\Form('form_bank_account', 500);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_bank_account', 'form_bank_account'));
     $oForm->addElement(new \PFBC\Element\Token('bank_account'));
     if (AdminCore::auth() && !Affiliate::auth() && $oHR->getExists('profile_id')) {
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<p class="center"><a class="s_button" href="' . Uri::get('affiliate', 'admin', 'browse') . '">' . t('Return to back affiliates browse') . '</a></p>'));
     }
     unset($oHR);
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<h2 class="underline">' . t('Bank Information:') . '</h2>'));
     $sHtmlPayPalIcon = '<a href="http://paypal.com" target="_blank"><img src="' . PH7_URL_STATIC . PH7_IMG . 'icon/paypal_small.gif" alt="PayPal" title="PayPal"></a><br />';
     $oForm->addElement(new \PFBC\Element\Email($sHtmlPayPalIcon . t('Your Bank Account:'), 'bank_account', array('id' => 'email_paypal', 'onblur' => 'CValid(this.value,this.id)', 'description' => t('Your Bank Account (PayPal Email Address).'), 'title' => t('Your Bank Account.'), 'value' => $oAff->bankAccount, 'validation' => new \PFBC\Validation\BankAccount(), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\HtmlExternal('<span class="input_error email_paypal"></span>'));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script>'));
     $oForm->render();
 }
Exemple #21
0
 public static function display()
 {
     if (isset($_POST['submit_edit'])) {
         if (\PFBC\Form::isValid($_POST['submit_edit'])) {
             new AdminEditFormProcess();
         }
         Framework\Url\HeaderUrl::redirect();
     }
     $oHttpRequest = new Http();
     $oGameModel = new GameModel();
     $iGameId = $oHttpRequest->get('id', 'int');
     $oGame = $oGameModel->get(strstr($oHttpRequest->get('title'), '-', true), $iGameId, 0, 1);
     $oCategoriesData = $oGameModel->getCategory(null, 0, 500);
     $aCategoriesName = array();
     foreach ($oCategoriesData as $oId) {
         $aCategoriesName[$oId->categoryId] = $oId->name;
     }
     unset($oHttpRequest, $oGameModel);
     $sTitlePattern = Config::getInstance()->values['module.setting']['url_title.pattern'];
     if (!empty($oGame) && (new Str())->equals($iGameId, $oGame->gameId)) {
         $oForm = new \PFBC\Form('form_edit', 650);
         $oForm->configure(array('action' => ''));
         $oForm->addElement(new \PFBC\Element\Hidden('submit_edit', 'form_edit'));
         $oForm->addElement(new \PFBC\Element\Token('edit'));
         $oForm->addElement(new \PFBC\Element\Select(t('Category Name:'), 'category_id', $aCategoriesName, array('value' => $oGame->categoryId, 'required' => 1)));
         $oForm->addElement(new \PFBC\Element\Textbox(t('Name of the Game:'), 'name', array('value' => $oGame->name, 'pattern' => $sTitlePattern, 'validation' => new \PFBC\Validation\RegExp($sTitlePattern), 'required' => 1)));
         $oForm->addElement(new \PFBC\Element\Textbox(t('Title of the Game:'), 'title', array('value' => $oGame->title, 'validation' => new \PFBC\Validation\Str(2, 120), 'required' => 1)));
         $oForm->addElement(new \PFBC\Element\Textbox(t('Description:'), 'description', array('value' => $oGame->description, 'validation' => new \PFBC\Validation\Str(2, 255), 'required' => 1)));
         $oForm->addElement(new \PFBC\Element\Textbox(t('Keywords:'), 'keywords', array('value' => $oGame->keywords, 'validation' => new \PFBC\Validation\Str(2, 255), 'required' => 1)));
         $oForm->addElement(new \PFBC\Element\Button());
         $oForm->render();
     } else {
         echo '<p class="center bold">' . t('Game Not Found!') . '</p>';
     }
 }
 public static function display()
 {
     $oForm = new \PFBC\Form('form_update_admin_ads', 500);
     $oForm->configure(array('action' => ''));
     $oForm = new \PFBC\Form('form_banner_ads', 500);
     $oPage = new Page();
     $oAdsModel = new AdsCoreModel();
     $oPage->getTotalPages($oAdsModel->total('AdsAffiliates'), 10);
     $oAds = $oAdsModel->get(null, $oPage->getFirstItem(), $oPage->getNbItemsByPage(), 'AdsAffiliates');
     unset($oPage, $oAdsModel);
     $oSysVar = new SysVar();
     foreach ($oAds as $oRow) {
         // Begin ads div tags
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<div id="ad_' . $oRow->adsId . '">'));
         $oForm->addElement(new \PFBC\Element\Hidden('id_ads', $oRow->adsId));
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<h2>' . $oRow->name . '</h2>'));
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<p>' . t('Preview Banner:') . '</p>'));
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<div>' . $oSysVar->parse($oRow->code) . '</div>'));
         $oForm->addElement(new \PFBC\Element\Textarea(t('Banner:'), 'code', array('readonly' => 'readonly', 'onclick' => 'this.select()', 'value' => $oSysVar->parse($oRow->code))));
         // End ads div tags
         $oForm->addElement(new \PFBC\Element\HTMLExternal('</div>'));
         $oForm->addElement(new \PFBC\Element\HTMLExternal('<br /><hr /><br />'));
     }
     $oForm->render();
 }
 public static function display()
 {
     $bAdminLogged = AdminCore::auth() && !UserCore::auth();
     $oForm = new \PFBC\Form('form_search', 500);
     $sUrl = $bAdminLogged ? Uri::get('mail', 'admin', 'msglist') : Uri::get('mail', 'main', 'result');
     $oForm->configure(array('action' => $sUrl . PH7_SH, 'method' => 'get'));
     $oForm->addElement(new \PFBC\Element\Search(t('Search a message:'), 'looking', array('title' => t('Enter a keyword in the Subject, Contents, Author (username, first name, last name) or message ID.'))));
     $oForm->addElement(new \PFBC\Element\Select(t('Browse By:'), 'order', array(SearchCoreModel::TITLE => t('Subject'), SearchCoreModel::USERNAME => t('Author (username)'), SearchCoreModel::SEND_DATE => t('Recent'))));
     if (!$bAdminLogged) {
         $oForm->addElement(new \PFBC\Element\Select(t('Where:'), 'where', array(MailModel::INBOX => t('Inbox'), MailModel::OUTBOX => t('Outbox'), MailModel::TRASH => t('Trash'))));
     }
     $oForm->addElement(new \PFBC\Element\Select(t('Direction:'), 'sort', array(SearchCoreModel::ASC => t('Ascending'), SearchCoreModel::DESC => t('Descending'))));
     $oForm->addElement(new \PFBC\Element\Button(t('Search'), 'submit', array('icon' => 'search')));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_add_fake_profiles'])) {
         if (\PFBC\Form::isValid($_POST['submit_add_fake_profiles'])) {
             new AddFakeProfilesFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_add_fake_profiles', 550);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_add_fake_profiles', 'form_add_fake_profiles'));
     $oForm->addElement(new \PFBC\Element\Token('fake_profiles'));
     $oForm->addElement(new \PFBC\Element\Select(t('Number:'), 'num', array('1', '5', '10', '15'), array('description' => t('Number of fake profiles to add in the same time.'), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Button(t('Add Fake Profiles!')));
     $oForm->render();
 }
Exemple #25
0
 public static function display()
 {
     if (isset($_POST['submit_license'])) {
         if (\PFBC\Form::isValid($_POST['submit_license'])) {
             new LicenseFormProcess(self::$_iLicenseId);
         }
         Framework\Url\HeaderUrl::redirect(Uri::get(PH7_ADMIN_MOD, 'setting', 'license', '?set_msg=1'));
     }
     $oForm = new \PFBC\Form('form_license', 500);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_license', 'form_license'));
     $oForm->addElement(new \PFBC\Element\Token('license'));
     $oForm->addElement(new \PFBC\Element\Textbox(t('Your License Key'), 'copyright_key', array('description' => '<strong><a href="' . Core::SOFTWARE_LICENSE_KEY_URL . '">' . t('Buy a license') . '</a></strong> ' . t('to remove the links from us.'), 'value' => (new License())->get(self::$_iLicenseId), 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Button(t('Register'), 'submit', array('icon' => 'key')));
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_style'])) {
         if (\PFBC\Form::isValid($_POST['submit_style'])) {
             new StyleFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_style');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_style', 'form_style'));
     $oForm->addElement(new \PFBC\Element\Token('style'));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Your custon CSS code'), 'code', array('value' => (new Design())->customCode('css'), 'description' => t("WARNING! Here, you don't need to add the %0% tags.", '<b><i>&lt;style&gt;&lt;/style&gt;</i></b>'), 'style' => 'height:450px')));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_analytics'])) {
         if (\PFBC\Form::isValid($_POST['submit_analytics'])) {
             new AnalyticsApiFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_analytics', 500);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_analytics', 'form_analytics'));
     $oForm->addElement(new \PFBC\Element\Token('analytics'));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Your code analytics (e.g., Google Analytics)'), 'code', array('value' => (new Design())->analyticsApi(false, false))));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_wall'])) {
         if (\PFBC\Form::isValid($_POST['submit_wall'])) {
             new WallFormProcess();
         }
         Framework\Url\Header::redirect();
     }
     $oForm = new \PFBC\Form('form_wall', 500);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_wall', 'form_wall'));
     $oForm->addElement(new \PFBC\Element\Token('wall'));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Content:'), 'post', array('validation' => new \PFBC\Validation\Str(1, 900))));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
 public static function display()
 {
     if (isset($_POST['submit_file'])) {
         if (\PFBC\Form::isValid($_POST['submit_file'])) {
             new PublicFileFormProcess();
         }
         Framework\Url\HeaderUrl::redirect();
     }
     $rData = file_get_contents(PH7_PATH_ROOT . $_GET['file']);
     $oForm = new \PFBC\Form('form_file', '100%');
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_file', 'form_file'));
     $oForm->addElement(new \PFBC\Element\Token('file'));
     $oForm->addElement(new \PFBC\Element\Textarea(t('File Content'), 'content', array('value' => $rData, 'style' => 'height:650px', 'required' => 1)));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }
Exemple #30
0
 public static function display()
 {
     if (isset($_POST['submit_edit_wall'])) {
         if (\PFBC\Form::isValid($_POST['submit_edit_wall'])) {
             new EditWallFormProcess();
         }
         Framework\Url\HeaderUrl::redirect();
     }
     $oWallData = (new WallModel())->get((new Session())->get('member_id'), (new Http())->get('wall_id'), 0, 1);
     $oForm = new \PFBC\Form('form_edit_wall', 500);
     $oForm->configure(array('action' => ''));
     $oForm->addElement(new \PFBC\Element\Hidden('submit_edit_wall', 'form_edit_wall'));
     $oForm->addElement(new \PFBC\Element\Token('edit_wall'));
     $oForm->addElement(new \PFBC\Element\Textarea(t('Content:'), 'post', array('value' => $oWallData->post, 'validation' => new \PFBC\Validation\Str(1, 900))));
     $oForm->addElement(new \PFBC\Element\Button());
     $oForm->render();
 }