本文整理汇总了PHP中Client::isCatalog方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::isCatalog方法的具体用法?PHP Client::isCatalog怎么用?PHP Client::isCatalog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client::isCatalog方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modification
function modification($filename)
{
if (Client::isCatalog()) {
$file = DIR_MODIFICATION . 'catalog/' . substr($filename, strlen(Client::getDir()));
} else {
$file = DIR_MODIFICATION . 'admin/' . substr($filename, strlen(Client::getDir()));
}
if (substr($filename, 0, strlen(DIR_SYSTEM)) == DIR_SYSTEM) {
$file = DIR_MODIFICATION . 'system/' . substr($filename, strlen(DIR_SYSTEM));
}
if (is_file($file)) {
return $file;
}
return $filename;
}
示例2: view
public function view($template, $data = array())
{
$theme_dir = Client::isCatalog() ? 'theme' : 'template';
$file = Client::getDir() . 'view/' . $theme_dir . '/' . $template;
if (file_exists($file)) {
$event_args = array(&$template, &$data);
$this->trigger->fire('pre.load.view', $event_args);
extract($data);
ob_start();
require $file;
$output = ob_get_contents();
ob_end_clean();
$this->trigger->fire('post.load.view', $output);
return $output;
} else {
trigger_error('Error: Could not load template ' . $file . '!');
exit;
}
}
示例3: __construct
public function __construct($registry = '')
{
if (!empty($registry)) {
$this->db = $registry->get('db');
$this->config = $registry->get('config');
$this->security = $registry->get('security');
}
if (is_object($this->config) and $this->config->get('config_sec_htmlpurifier')) {
$config = HTMLPurifier_Config::createDefault();
$this->purifier = new HTMLPurifier($config);
}
if (is_object($this->security) && Client::isCatalog()) {
$this->security->checkRequest($_GET, 'get');
$this->security->checkRequest($_POST, 'post');
}
$this->get = $this->clean($_GET);
$this->post = $this->clean($_POST);
$this->request = $this->clean($_REQUEST);
$this->cookie = $this->clean($_COOKIE);
$this->files = $this->clean($_FILES);
$this->server = $this->clean($_SERVER);
}
示例4: getLanguage
public function getLanguage()
{
$lang = null;
$languages = array();
$prefix = Client::isAdmin() ? 'admin_' : '';
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "language` WHERE status = '1'");
foreach ($query->rows as $result) {
$languages[$result['code']] = $result;
}
if (isset($this->request->get['lang']) && array_key_exists($this->request->get['lang'], $languages) && $languages[$this->request->get['lang']]['status']) {
$code = $this->request->get['lang'];
} elseif (isset($this->session->data[$prefix . 'language']) && array_key_exists($this->session->data[$prefix . 'language'], $languages) && $languages[$this->session->data[$prefix . 'language']]['status']) {
$code = $this->session->data[$prefix . 'language'];
} elseif (isset($this->request->cookie[$prefix . 'language']) && array_key_exists($this->request->cookie[$prefix . 'language'], $languages) && $languages[$this->request->cookie[$prefix . 'language']]['status']) {
$code = $this->request->cookie[$prefix . 'language'];
} else {
// Try to get the language from SEF URL
if (Client::isCatalog() && $this->config->get('config_seo_url')) {
$route = str_replace($this->url->getFullUrl(), '', rawurldecode($this->uri->toString()));
$route = str_replace('?' . $this->uri->getQuery(), '', $route);
$route_parts = explode('/', str_replace('index.php/', '', $route));
if (!empty($route_parts[0]) && strlen($route_parts[0]) == 2) {
$code = $route_parts[0];
} else {
$code = $this->getBrowserDefaultLanguage($languages);
}
} else {
$code = $this->getBrowserDefaultLanguage($languages);
}
}
// Check if lang code exists in db, otherwise return the first lang
if (isset($languages[$code])) {
$lang = $languages[$code];
} else {
$lang = array_values($languages)[0];
}
return $lang;
}
示例5: view
public function view($template, $data = array())
{
$theme_dir = Client::isCatalog() ? 'theme' : 'template';
if (Client::isAdmin() && isset($this->session->data['theme']) && $this->session->data['theme'] != 'advanced') {
if (file_exists(Client::getDir() . 'view/theme/' . $this->session->data['theme'] . '/template/' . $template)) {
$theme_dir = 'theme/' . $this->session->data['theme'] . '/template';
}
}
$file = Client::getDir() . 'view/' . $theme_dir . '/' . $template;
if (file_exists($file)) {
$this->trigger->fire('pre.load.view', array(&$template, &$data));
extract($data);
ob_start();
require $file;
$output = ob_get_contents();
ob_end_clean();
$this->trigger->fire('post.load.view', array(&$output));
return $output;
} else {
trigger_error('Error: Could not load template ' . $file . '!');
exit;
}
}
示例6: getMessage
public function getMessage($type, $template_id, $data)
{
$template = $this->getEmailTemplate($template_id);
$findFunctionName = 'get' . ucwords($type) . 'Find';
$replaceFunctionName = 'get' . ucwords($type) . 'Replace';
$find = array();
if (method_exists($this, $findFunctionName)) {
$find = $this->{$findFunctionName}();
}
$this->trigger->fire('post.emailtemplate.message.shortcode', array(&$find));
$replace = array();
if (method_exists($this, $replaceFunctionName)) {
$replace = $this->{$replaceFunctionName}($data);
}
$this->trigger->fire('post.emailtemplate.message.replace', array(&$replace, &$data));
if (!empty($template['description'])) {
if (ucwords($type) == 'OrderAll') {
preg_match('/{product:start}(.*){product:stop}/Uis', $template['description'], $template_product);
if (!empty($template_product[1])) {
$template['description'] = str_replace($template_product[1], '', $template['description']);
}
preg_match('/{voucher:start}(.*){voucher:stop}/Uis', $template['description'], $template_voucher);
if (!empty($template_voucher[1])) {
$template['description'] = str_replace($template_voucher[1], '', $template['description']);
}
preg_match('/{comment:start}(.*){comment:stop}/Uis', $template['description'], $template_comment);
if (!empty($template_comment[1])) {
$template['description'] = str_replace($template_comment[1], '', $template['description']);
}
preg_match('/{tax:start}(.*){tax:stop}/Uis', $template['description'], $template_tax);
if (!empty($template_tax[1])) {
$template['description'] = str_replace($template_tax[1], '', $template['description']);
}
preg_match('/{total:start}(.*){total:stop}/Uis', $template['description'], $template_total);
if (!empty($template_total[1])) {
$template['description'] = str_replace($template_total[1], '', $template['description']);
}
}
$message = trim(str_replace($find, $replace, $template['description']));
} else {
$message = $this->getDefaultMessage($type, $template_id, $data);
}
$data['title'] = $this->getSubject($type, $template_id, $data);
$data['message'] = $message;
$data['site_url'] = $this->request->server['HTTPS'] ? HTTPS_SERVER : HTTP_SERVER;
if (Client::isCatalog()) {
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/mail/default.tpl')) {
$message = $this->load->view($this->config->get('config_template') . '/template/mail/default.tpl', $data);
} else {
$message = $this->load->view('default/template/mail/default.tpl', $data);
}
} else {
$message = $this->load->view('mail/default.tpl', $data);
}
return $message;
}
示例7: useSSL
public function useSSL($secure)
{
$ret = false;
if (is_object($this->config)) {
// keep B/C alive
$config_secure = $this->config->get('config_secure');
if ($config_secure == 3) {
// everywhere
$ret = true;
} else {
if ($config_secure == 2 and Client::isCatalog()) {
// catalog
$ret = true;
} else {
if ($config_secure == 1 and Client::isCatalog() and $secure == true) {
// checkout
$ret = true;
}
}
}
} else {
if ($secure) {
$ret = true;
}
}
return $ret;
}