public static function display() { if (isset($_POST['submit_ads'])) { if (\PFBC\Form::isValid($_POST['submit_ads'])) { new AdsFormProcess(); } Framework\Url\Header::redirect(); } $aAdSizes = Import::file(PH7_PATH_APP_CONFIG . 'ad_sizes'); $oForm = new \PFBC\Form('form_ads', 500); $oForm->configure(array('action' => '')); $oForm->addElement(new \PFBC\Element\Hidden('submit_ads', 'form_ads')); $oForm->addElement(new \PFBC\Element\Token('ads')); $oForm->addElement(new \PFBC\Element\Textbox(t('Title:'), 'title', array('required' => 1, 'validation' => new \PFBC\Validation\Str(2, 40)))); $oForm->addElement(new \PFBC\Element\Select(t('Size of the Banner:'), 'size', $aAdSizes, array('required' => 1))); $sText = AdsCore::getTable() == 'AdsAffiliates' ? t('The predefined variable for the URL of an affiliate account to put in the HTML is: %0%.', '<strong>#!%affiliate_url%!#</strong>') : t('The predefined variable to the URL of your site to indicate this in the HTML is: %0%.', '<strong>#!%site_url%!#</strong>'); $oForm->addElement(new \PFBC\Element\Textarea(t('Banner:'), 'code', array('description' => $sText, 'required' => 1))); $oForm->addElement(new \PFBC\Element\Button()); $oForm->render(); }
/** * Get the instructions. * * @param string $sInstFile Instruction file. * @return mixed (string or boolean) Returns "false" if the file does not exist or if it fails, otherwise returns the "file contents" */ private function _readInstruction($sInstFile) { try { return F\Import::file(PH7_PATH_REPOSITORY . static::DIR . PH7_DS . $this->_sUpgradesDirUpgradeFolder . static::INFO_DIR . PH7_DS . $sInstFile); } catch (Framework\File\Exception $e) { return '<p class="error">' . t('Instruction file not found!') . '</p>'; } }
* First off, check it the server is connected to the Internet. */ if (!is_internet()) { $sMsg = '<p class="warning">No Internet Connection</p> <p>Whoops! Your server has to be connect to the Internet in order to get your website working.</p>'; echo html_body('Enable your Internet connection', $sMsg); exit; } // Loading Framework Classes require PH7_PATH_FRAMEWORK . 'Loader/Autoloader.php'; Framework\Loader\Autoloader::getInstance()->init(); /** Loading configuration files environments **/ // For All environment Import::file(PH7_PATH_APP . 'configs/environment/all.env'); // Specific to the current environment Import::file(PH7_PATH_APP . 'configs/environment/' . Config::getInstance()->values['application']['environment'] . '.env'); // Loading Class ~/protected/app/includes/classes/* Import::pH7App('includes.classes.Loader.Autoloader'); App\Includes\Classes\Loader\Autoloader::getInstance()->init(); // Loading Debug class Import::pH7FwkClass('Error.Debug'); // Loading String Class Import::pH7FwkClass('Str.Str'); /* Structure/General.class.php functions are not currently used */ // Import::pH7FwkClass('Structure.General'); /*** End Loading Files ***/ //** Temporary code. In the near future, pH7CMS will be usable without mod_rewrite if (!Server::isRewriteMod()) { $sMsg = '<p class="warning"><a href="' . Framework\Core\Kernel::SOFTWARE_WEBSITE . '">pH7CMS</a> requires Apache "mod_rewrite".</p> <p>Please install it so that pH7CMS can works.<br /> Click <a href="http://ph7cms.com/doc/en/how-to-install-rewrite-module" target="_blank">here</a> if you want to get more information on how to install the rewrite module.<br /><br /> After doing this, please <a href="' . PH7_URL_ROOT . '">retry</a>.</p>';
/** * Get the instructions. * * @param string $sInstFile Instruction file. * @return mixed (string or boolean) Returns "false" if the file does not exist or if it fails, otherwise returns the "file contents" */ private function _readInstruction($sInstFile) { $mInstruction = F\Import::file(PH7_PATH_REPOSITORY . static::DIR . PH7_DS . $this->_sUpgradesDirUpgradeFolder . static::INFO_DIR . PH7_DS . $sInstFile); return !$mInstruction ? '<p class="error">' . t('Instruction file not found!') . '</p>' : $mInstruction; }
/** * Get the instructions. * * @param string $sSwitch Module::INSTALL or Module::UNINSTALL constant. * @return mixed (string or boolean) Returns "false" if the file does not exist or if it fails, otherwise returns the "file contents". */ public function readInstruction($sSwitch) { $sValue = $this->_checkParam($sSwitch); $sDir = $this->_sModsDirModFolder . static::INSTALL_DIR . PH7_DS . static::INFO_DIR . PH7_DS; $sPath = $sValue == static::INSTALL ? PH7_PATH_MOD . $sDir . static::INSTALL_INST_CONCL_FILE : PH7_PATH_REPOSITORY . static::DIR . PH7_DS . $sDir . static::UNINSTALL_INST_CONCL_FILE; $mInstruction = F\Import::file($sPath); return !$mInstruction ? '<p class="error">' . t('Instruction file not found!') . '</p>' : $mInstruction; }
/** * Get the instructions. * * @param string $sSwitch Module::INSTALL or Module::UNINSTALL constant. * @return mixed (string or boolean) Returns "false" if the file does not exist or if it fails, otherwise returns the "file contents". */ public function readInstruction($sSwitch) { $sValue = $this->_checkParam($sSwitch); $sDir = $this->_sModsDirModFolder . static::INSTALL_DIR . PH7_DS . static::INFO_DIR . PH7_DS; $sPath = $sValue == static::INSTALL ? PH7_PATH_MOD . $sDir . static::INSTALL_INST_CONCL_FILE : PH7_PATH_REPOSITORY . static::DIR . PH7_DS . $sDir . static::UNINSTALL_INST_CONCL_FILE; try { return F\Import::file($sPath); } catch (Framework\File\Exception $e) { return '<p class="error">' . t('Instruction file not found!') . '</p>'; } }