本文整理汇总了PHP中cmsCore::loadLib方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::loadLib方法的具体用法?PHP cmsCore::loadLib怎么用?PHP cmsCore::loadLib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsCore
的用法示例。
在下文中一共展示了cmsCore::loadLib方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
private function __construct()
{
$this->inDB = cmsDatabase::getInstance();
cmsCore::loadLanguage('components/blogs');
cmsCore::loadLib('tags');
cmsCore::loadLib('karma');
}
示例2: __construct
public function __construct()
{
$this->inDB = cmsDatabase::getInstance();
$this->config = cmsCore::getInstance()->loadComponentConfig('clubs');
cmsCore::loadLanguage('components/clubs');
cmsCore::loadLib('karma');
}
示例3: initTransport
/**
* Инициализирует почтовый транспорт по настройкам
* из глобального конфига сайта
* @return \cmsMailer
*/
public function initTransport()
{
$config = cmsConfig::getInstance();
// PHP mail()
if ($config->mail_transport == 'mail') {
return $this;
}
// SMTP Server
if ($config->mail_transport == 'smtp') {
cmsCore::loadLib('phpmailer/class.smtp', 'SMTP');
$this->mailer->IsSMTP();
$this->mailer->Host = $config->mail_smtp_server;
$this->mailer->Port = $config->mail_smtp_port;
$this->mailer->SMTPAuth = (bool) $config->mail_smtp_auth;
$this->mailer->SMTPKeepAlive = true;
$this->mailer->Username = $config->mail_smtp_user;
$this->mailer->Password = $config->mail_smtp_pass;
if (!empty($config->mail_smtp_enc)) {
$this->mailer->SMTPSecure = $config->mail_smtp_enc;
}
return $this;
}
// SendMail
if ($config->mail_transport == 'sendmail') {
$this->mailer->IsSendmail();
return $this;
}
}
示例4: __construct
public function __construct()
{
$config = cmsConfig::getInstance();
cmsCore::loadLib('phpmailer/class.phpmailer', 'PHPMailer');
$this->mailer = new PHPMailer();
$this->mailer->CharSet = 'UTF-8';
$this->initTransport()->setFrom($config->mail_from)->setBodyText(LANG_MAIL_DEFAULT_ALT);
}
示例5: getInstance
public static function getInstance()
{
if (self::$instance === null) {
self::$instance = new self();
// подключаем хелпер основного шаблона
if (!cmsCore::includeFile('templates/' . self::$instance->getName() . '/assets/helper.php')) {
cmsCore::loadLib('template.helper');
}
}
return self::$instance;
}
示例6: __construct
public function __construct() {
$this->query = self::getQuery();
$this->look = cmsCore::request('look', 'str', 'allwords');
$this->page = cmsCore::request('page', 'int', 1);
$this->from_pubdate = cmsCore::request('from_pubdate', 'str', '');
$this->order_by_date = cmsCore::request('order_by_date', array(0, 1), 0);
$this->from_component = self::getComponentsArrayForSearch();
$this->config = cmsCore::getInstance()->loadComponentConfig('search');
cmsCore::loadLib('tags');
$this->getComponentsWithSupportSearch();
$this->parametrs_array = $this->gatherAnArrayOfQueryParametrs();
cmsCore::loadLanguage('other/sphinx');
}
示例7: applet_tree
function applet_tree()
{
$inCore = cmsCore::getInstance();
cmsCore::loadLib('tags');
global $_LANG;
global $adminAccess;
if (!cmsUser::isAdminCan('admin/content', $adminAccess)) {
cpAccessDenied();
}
cmsCore::c('page')->setTitle($_LANG['AD_ARTICLES']);
cpAddPathway($_LANG['AD_ARTICLES'], 'index.php?view=tree');
cmsCore::c('page')->addHeadJS('admin/js/content.js');
echo '<script>';
echo cmsPage::getLangJS('AD_NO_SELECTED_ARTICLES');
echo cmsPage::getLangJS('AD_DELETE_SELECTED_ARTICLES');
echo cmsPage::getLangJS('AD_PIECES');
echo cmsPage::getLangJS('AD_CATEGORY_DELETE');
echo cmsPage::getLangJS('AD_AND_SUB_CATS');
echo cmsPage::getLangJS('AD_DELETE_SUB_ARTICLES');
echo '</script>';
$do = cmsCore::request('do', 'str', 'tree');
if ($do == 'tree') {
$toolmenu = array(array('icon' => 'config.gif', 'title' => $_LANG['AD_SETUP_CATEGORY'], 'link' => '?view=components&do=config&link=content'), array('icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=components&do=config&link=content'));
cpToolMenu($toolmenu);
$only_hidden = cmsCore::request('only_hidden', 'int', 0);
$category_id = cmsCore::request('cat_id', 'int', 0);
$base_uri = 'index.php?view=tree';
$title_part = cmsCore::request('title', 'str', '');
$def_order = $category_id ? 'con.ordering' : 'pubdate';
$orderby = cmsCore::request('orderby', 'str', $def_order);
$orderto = cmsCore::request('orderto', 'str', 'asc');
$page = cmsCore::request('page', 'int', 1);
$perpage = 20;
if ($category_id) {
cmsCore::m('content')->whereCatIs($category_id);
}
if ($title_part) {
cmsCore::c('db')->where('LOWER(con.title) LIKE \'%' . mb_strtolower($title_part) . '%\'');
}
if ($only_hidden) {
cmsCore::c('db')->where('con.published = 0');
}
cmsCore::c('db')->orderBy($orderby, $orderto);
cmsCore::c('db')->limitPage($page, $perpage);
$total = cmsCore::m('content')->getArticlesCount(false);
cmsCore::c('page')->initTemplate('applets', 'tree')->assign('hide_cats', cmsCore::request('hide_cats', 'int', 0))->assign('only_hidden', $only_hidden)->assign('base_uri', $base_uri)->assign('category_id', $category_id)->assign('cats', cmsCore::m('content')->getCatsTree())->assign('orderto', $orderto)->assign('orderby', $orderby)->assign('title_part', $title_part)->assign('category_opt', $inCore->getListItemsNS('cms_category', $category_id))->assign('page', $page)->assign('total', $total)->assign('perpage', $perpage)->assign('pages', ceil($total / $perpage))->assign('items', cmsCore::m('content')->getArticlesList(false))->display();
}
}
示例8: __construct
function __construct($name = '')
{
$config = cmsConfig::getInstance();
$this->name = $name ? $name : $config->template;
$this->setLayout('main');
$this->title = $config->sitename;
$is_no_def_meta = isset($config->is_no_meta) ? $config->is_no_meta : false;
if (!$is_no_def_meta) {
$this->metakeys = $config->metakeys;
$this->metadesc = $config->metadesc;
}
$this->path = $config->root_path . 'templates/' . $this->name;
$this->options = $this->getOptions();
if (!cmsCore::includeFile('templates/' . $this->name . '/assets/helper.php')) {
cmsCore::loadLib('template.helper');
}
}
示例9: yamlToArray
/**
* Преобразует YAML в массив
* @param string $yaml
* @return array
*/
public static function yamlToArray($yaml)
{
cmsCore::loadLib('spyc.class');
return Spyc::YAMLLoadString($yaml);
}
示例10: __construct
private function __construct(){
cmsCore::loadLib('tags');
cmsCore::loadLanguage('components/photos');
}
示例11: define
<?php
// Определяем корень
define('PATH', dirname(__FILE__));
define('ROOT', $_SERVER['DOCUMENT_ROOT']);
// Устанавливаем кодировку
mb_internal_encoding('UTF-8');
// Подключаем автозагрузчик классов
require_once PATH . '/system/config/autoload.php';
// Устанавливаем обработчик автозагрузки классов
spl_autoload_register('autoLoadCoreClass');
// Инициализируем конфиг
$config = cmsConfig::getInstance();
// Загружаем локализацию
cmsCore::loadLanguage();
// Устанавливаем часовую зону
date_default_timezone_set($config->time_zone);
// Подключаем все необходимые классы и библиотеки
cmsCore::loadLib('html.helper');
cmsCore::loadLib('strings.helper');
cmsCore::loadLib('files.helper');
// Инициализируем ядро
$core = cmsCore::getInstance();
// Подключаем базу
$core->connectDB();
// Запускаем кеш
cmsCache::getInstance()->start();
示例12: __construct
public function __construct()
{
$this->inDB = cmsDatabase::getInstance();
cmsCore::loadLib('tags');
$this->config = cmsCore::getInstance()->loadComponentConfig('catalog');
}
示例13: __construct
public function __construct() {
$this->config = cmsCore::getInstance()->loadComponentConfig('photos');
cmsCore::loadLib('karma');
cmsCore::loadLanguage('components/photos');
}
示例14: __construct
private function __construct(){
cmsCore::loadLanguage('components/blogs');
cmsCore::loadLib('tags');
cmsCore::loadLib('karma');
}
示例15: actionIndex
public function actionIndex()
{
header('X-Frame-Options: DENY');
// $original_url для кириллических доменов
$url = $original_url = urldecode($this->request->get('url', ''));
if (!$url) {
cmsCore::error404();
}
if ($this->request->isAjax()) {
cmsCore::error404();
}
$url_host = parse_url($url, PHP_URL_HOST);
if (!$url_host) {
cmsCore::error404();
}
if (!empty($this->options['is_check_refer'])) {
if (empty($_SERVER['HTTP_REFERER'])) {
cmsCore::error404();
}
if (strpos($_SERVER['HTTP_REFERER'], $this->cms_config->protocol . $_SERVER['HTTP_HOST']) !== 0) {
cmsCore::error404();
}
}
// кириллические домены
if (preg_match('/^[а-яё]+/iu', $url_host)) {
cmsCore::loadLib('idna_convert.class');
$IDN = new idna_convert();
$host = $IDN->encode($url_host);
$url = str_ireplace($url_host, $host, $url);
}
// ссылки, по которым редиректить сразу
if (!empty($this->options['no_redirect_list_array'])) {
if (in_array($url_host, $this->options['no_redirect_list_array'], true)) {
$this->redirect($url);
}
}
// флаг бана домена
$is_domain_banned = false;
// флаг того, что домен в нашем черном списке
$is_domain_in_black_list = false;
// сначала проверяем черный список
if (!empty($this->options['black_list_array'])) {
if (in_array($url_host, $this->options['black_list_array'])) {
$is_domain_banned = true;
$is_domain_in_black_list = true;
}
}
// если пользователь поставил "печеньку"
if (!$is_domain_in_black_list && $this->cms_user->is_logged && cmsUser::getCookie('allow_redirect')) {
$this->redirect($url);
}
// теперь проверяем ссылку
if (!$is_domain_banned && function_exists('curl_init') && !empty($this->options['is_check_link'])) {
if (empty($this->options['white_list_array']) || $this->options['white_list_array'] && !in_array($url_host, $this->options['white_list_array'])) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.vk.com/method/utils.checkLink?url=' . $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 2);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'InstantCMS/2.0 +' . cmsConfig::get('host'));
$data = json_decode(curl_exec($ch), true);
if (!isset($data['error']) && isset($data['response'])) {
$is_domain_banned = $data['response']['status'] == 'banned';
$url = $data['response']['link'];
}
}
}
return $this->cms_template->render('index', array('url' => $url, 'user' => $this->cms_user, 'original_url' => $original_url, 'is_domain_banned' => $is_domain_banned, 'is_domain_in_black_list' => $is_domain_in_black_list, 'sitename' => cmsConfig::get('sitename'), 'host' => cmsConfig::get('host'), 'redirect_time' => $this->options['redirect_time']));
}