本文整理匯總了PHP中util::formatAppPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP util::formatAppPath方法的具體用法?PHP util::formatAppPath怎麽用?PHP util::formatAppPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類util
的用法示例。
在下文中一共展示了util::formatAppPath方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor.
*
* @param oktCore $okt
* @param array $aConfig
* @param string $sBase
* @param string $sTplFamily
* @param string $sBaseUrl
* @return void
*/
public function __construct($okt, $aConfig, $sBase, $sTplFamily, $sBaseUrl = '/')
{
$this->okt = $okt;
$this->aConfig = $aConfig;
$this->sTplFamily = $sTplFamily;
$this->sBase = util::formatAppPath($sBase, false, false);
$this->sBaseUrl = $sBaseUrl;
$this->loadTemplatesPaths();
$this->loadTemplatesInfos();
l10n::set(OKT_LOCALES_PATH . '/' . $this->okt->user->language . '/admin.templates.config');
# téléchargement d'un template
if (!empty($_GET['tpl_download']) && !empty($_GET['tpl_id']) && array_key_exists(rawurldecode($_GET['tpl_id']), $this->getTplInfos()) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
$this->dowloadTemplate(rawurldecode($_GET['tpl_id']));
}
# suppression d'un template
if (!empty($_GET['tpl_delete']) && !empty($_GET['tpl_id']) && array_key_exists(rawurldecode($_GET['tpl_id']), $this->getTplInfos()) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
$this->deleteTemplate(rawurldecode($_GET['tpl_id']));
$this->okt->redirect($this->sBaseUrl . 'tpl_family=' . rawurlencode($this->sTplFamily) . '&tpl_deleted=1');
}
if (isset($this->okt->page) && !empty($_GET['tpl_family']) && rawurldecode($_GET['tpl_family']) == $this->sTplFamily) {
$this->okt->page->messages->success('tpl_deleted', __('c_a_tpl_config_tpl_deleted'));
}
}
示例2: intval
$p_enable_categories = !empty($_POST['p_enable_categories']) ? true : false;
$p_enable_rte = !empty($_POST['p_enable_rte']) ? $_POST['p_enable_rte'] : '';
$p_chp_name = !empty($_POST['p_chp_name']) ? intval($_POST['p_chp_name']) : 0;
$p_chp_description = !empty($_POST['p_chp_description']) ? intval($_POST['p_chp_description']) : 0;
$p_chp_url = !empty($_POST['p_chp_url']) ? intval($_POST['p_chp_url']) : 0;
$p_chp_url_title = !empty($_POST['p_chp_url_title']) ? intval($_POST['p_chp_url_title']) : 0;
$p_chp_logo = !empty($_POST['p_chp_logo']) ? intval($_POST['p_chp_logo']) : 0;
$aImagesConfig = $oImageUploadConfig->getPostConfig();
$p_name = !empty($_POST['p_name']) && is_array($_POST['p_name']) ? $_POST['p_name'] : array();
$p_name_seo = !empty($_POST['p_name_seo']) && is_array($_POST['p_name_seo']) ? $_POST['p_name_seo'] : array();
$p_title = !empty($_POST['p_title']) && is_array($_POST['p_title']) ? $_POST['p_title'] : array();
$p_meta_description = !empty($_POST['p_meta_description']) && is_array($_POST['p_meta_description']) ? $_POST['p_meta_description'] : array();
$p_meta_keywords = !empty($_POST['p_meta_keywords']) && is_array($_POST['p_meta_keywords']) ? $_POST['p_meta_keywords'] : array();
$p_public_url = !empty($_POST['p_public_url']) && is_array($_POST['p_public_url']) ? $_POST['p_public_url'] : array();
foreach ($p_public_url as $lang => $url) {
$p_public_url[$lang] = util::formatAppPath($url, false, false);
}
if ($okt->error->isEmpty()) {
$new_conf = array('enable_categories' => (bool) $p_enable_categories, 'enable_rte' => $p_enable_rte, 'chp_name' => (int) $p_chp_name, 'chp_description' => (int) $p_chp_description, 'chp_url' => (int) $p_chp_url, 'chp_url_title' => (int) $p_chp_url_title, 'chp_logo' => (int) $p_chp_logo, 'name' => $p_name, 'name_seo' => $p_name_seo, 'title' => $p_title, 'meta_description' => $p_meta_description, 'meta_keywords' => $p_meta_keywords, 'public_url' => $p_public_url, 'images' => $aImagesConfig);
try {
$okt->partners->config->write($new_conf);
$okt->page->flashMessages->addSuccess(__('c_c_confirm_configuration_updated'));
$okt->redirect('module.php?m=partners&action=config');
} catch (InvalidArgumentException $e) {
$okt->error->set(__('c_c_error_writing_configuration'));
$okt->error->set($e->getMessage());
}
}
}
/* Affichage
----------------------------------------------------------*/
示例3: intval
$p_chp_price = !empty($_POST['p_chp_price']) ? intval($_POST['p_chp_price']) : 0;
$p_chp_promo = !empty($_POST['p_chp_promo']) ? intval($_POST['p_chp_promo']) : 0;
$p_chp_nouvo = !empty($_POST['p_chp_nouvo']) ? intval($_POST['p_chp_nouvo']) : 0;
$p_chp_favo = !empty($_POST['p_chp_favo']) ? intval($_POST['p_chp_favo']) : 0;
$p_enable_files = !empty($_POST['p_enable_files']) ? true : false;
$p_number_files = !empty($_POST['p_number_files']) ? intval($_POST['p_number_files']) : 0;
$p_allowed_exts = !empty($_POST['p_allowed_exts']) ? $_POST['p_allowed_exts'] : '';
$aImagesConfig = $oImageUploadConfig->getPostConfig();
$p_name = !empty($_POST['p_name']) ? $_POST['p_name'] : 'Actualités';
$p_title = !empty($_POST['p_title']) ? $_POST['p_title'] : '';
$p_meta_description = !empty($_POST['p_meta_description']) ? $_POST['p_meta_description'] : '';
$p_meta_keywords = !empty($_POST['p_meta_keywords']) ? $_POST['p_meta_keywords'] : '';
$p_public_catalog_url = !empty($_POST['p_public_catalog_url']) ? $_POST['p_public_catalog_url'] : '';
$p_public_catalog_url = util::formatAppPath($p_public_catalog_url, false, false);
$p_public_product_url = !empty($_POST['p_public_product_url']) ? $_POST['p_public_product_url'] : '';
$p_public_product_url = util::formatAppPath($p_public_product_url, false, false);
if (substr($p_public_product_url, 0, strlen($p_public_catalog_url)) == $p_public_catalog_url) {
$okt->error->set('L’URL de la liste des produits ne doit pas être la même que l’URL d’un produit.');
}
if ($okt->error->isEmpty()) {
$new_conf = array('name' => $p_name, 'title' => $p_title, 'meta_description' => $p_meta_description, 'meta_keywords' => $p_meta_keywords, 'categories_enable' => (bool) $p_categories_enable, 'seo_enable' => (bool) $p_seo_enable, 'enable_filters' => (bool) $p_enable_filters, 'rte_enable' => $p_rte_enable, 'public_catalog_url' => $p_public_catalog_url, 'public_product_url' => $p_public_product_url, 'fields' => array('subtitle' => (int) $p_chp_subtitle, 'content_short' => (int) $p_chp_content_short, 'price' => (int) $p_chp_price, 'promo' => (int) $p_chp_promo, 'nouvo' => (int) $p_chp_nouvo, 'favo' => (int) $p_chp_favo), 'files' => array('enable' => (bool) $p_enable_files, 'number' => $p_number_files, 'allowed_exts' => $p_allowed_exts), 'images' => $aImagesConfig);
try {
$okt->catalog->config->write($new_conf);
$okt->redirect('module.php?m=catalog&action=config&updated=1');
} catch (InvalidArgumentException $e) {
$okt->error->set(__('c_c_error_writing_configuration'));
$okt->error->set($e->getMessage());
}
}
}
/* Affichage
示例4: array
$p_email_to = !empty($_POST['p_email_to']) ? $_POST['p_email_to'] : '';
if ($p_email_to != '' && !text::isEmail($p_email_to)) {
$okt->error->set(sprintf(__('c_c_error_invalid_email'), html::escapeHTML($p_email_to)));
}
$p_email_from = !empty($_POST['p_email_from']) ? $_POST['p_email_from'] : '';
if ($p_email_from != '' && !text::isEmail($p_email_from)) {
$okt->error->set(sprintf(__('c_c_error_invalid_email'), html::escapeHTML($p_email_from)));
}
$p_email_name = !empty($_POST['p_email_name']) ? $_POST['p_email_name'] : '';
$p_title_tag = !empty($_POST['p_title_tag']) ? $_POST['p_title_tag'] : '';
$p_meta_description = !empty($_POST['p_meta_description']) ? $_POST['p_meta_description'] : '';
$p_meta_keywords = !empty($_POST['p_meta_keywords']) ? $_POST['p_meta_keywords'] : '';
$p_app_path = !empty($_POST['p_app_path']) ? $_POST['p_app_path'] : '/';
$p_app_path = util::formatAppPath($p_app_path);
$p_domain = !empty($_POST['p_domain']) ? $_POST['p_domain'] : '';
$p_domain = util::formatAppPath($p_domain, false, false);
if ($okt->error->isEmpty()) {
$new_conf = array('title' => array('fr' => $p_title), 'desc' => array('fr' => $p_desc), 'company' => array('name' => $p_company_name, 'com_name' => $p_company_com_name, 'siret' => $p_company_siret), 'address' => array('street' => $p_address_street, 'street_2' => $p_address_street_2, 'code' => $p_address_code, 'city' => $p_address_city, 'country' => $p_address_country, 'tel' => $p_address_tel, 'mobile' => $p_address_mobile, 'fax' => $p_address_fax), 'leader' => array('name' => $p_leader_name, 'firstname' => $p_leader_firstname), 'email' => array('to' => $p_email_to, 'from' => $p_email_from, 'name' => ''), 'title_tag' => array('fr' => $p_title_tag), 'meta_description' => array('fr' => $p_meta_description), 'meta_keywords' => array('fr' => $p_meta_keywords), 'app_path' => $p_app_path, 'domain' => $p_domain);
try {
$_SESSION['okt_install_chemin'] = $new_conf['app_path'];
$okt->config->write($new_conf);
http::redirect('index.php?step=' . $stepper->getNextStep());
} catch (InvalidArgumentException $e) {
$okt->error->set(__('c_c_error_writing_configuration'));
$okt->error->set($e->getMessage());
}
}
}
/* Affichage
------------------------------------------------------------*/
$oHtmlPage->tabs();