• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ipConfig函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ipConfig函数的典型用法代码示例。如果您正苦于以下问题:PHP ipConfig函数的具体用法?PHP ipConfig怎么用?PHP ipConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ipConfig函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: generatePasswordResetSecret

 private static function generatePasswordResetSecret($userId)
 {
     $secret = md5(ipConfig()->get('sessionName') . uniqid());
     $data = array('resetSecret' => $secret, 'resetTime' => time());
     ipDb()->update('administrator', $data, array('id' => $userId));
     return $secret;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:7,代码来源:Model.php


示例2: initConfig

 protected static function initConfig()
 {
     ipAddCss('Ip/Internal/Core/assets/admin/admin.css');
     ipAddJs('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.js');
     ipAddJsVariable('ipTranslationSaving', __('Saving...', 'Ip-admin', false));
     ipAddJs('Ip/Internal/Design/assets/optionsBox.js');
     ipAddJsVariable('ipModuleDesignConfiguration', Helper::getConfigurationBoxHtml());
     if (file_exists(ipThemeFile(Model::INSTALL_DIR . 'Options.js'))) {
         ipAddJs(ipThemeUrl(Model::INSTALL_DIR . 'Options.js'));
     } elseif (file_exists(ipThemeFile(Model::INSTALL_DIR . 'options.js'))) {
         ipAddJs(ipThemeUrl(Model::INSTALL_DIR . 'options.js'));
     }
     $model = Model::instance();
     $theme = $model->getTheme(ipConfig()->theme());
     if (!$theme) {
         throw new \Ip\Exception("Theme doesn't exist");
     }
     $options = $theme->getOptionsAsArray();
     $fieldNames = array();
     foreach ($options as $option) {
         if (empty($option['name'])) {
             continue;
         }
         $fieldNames[] = $option['name'];
     }
     ipAddJsVariable('ipModuleDesignOptionNames', $fieldNames);
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:27,代码来源:Event.php


示例3: render

    /**
     * Render field
     *
     * @param string $doctype
     * @param $environment
     * @return string
     */
    public function render($doctype, $environment)
    {
        return '
<input ' . $this->getAttributesStr($doctype) . ' style="display:none;" class="' . implode(' ', $this->getClasses()) . '" name="' . htmlspecialchars($this->getName()) . '[]"  ' . $this->getValidationAttributesStr($doctype) . ' type="hidden" value="" />
<input ' . $this->getAttributesStr($doctype) . ' style="display:none;" class="' . implode(' ', $this->getClasses()) . '" name="' . htmlspecialchars($this->getName()) . '[]"  ' . $this->getValidationAttributesStr($doctype) . ' type="hidden" value="' . htmlspecialchars(md5(date('Y-m-d') . ipConfig()->get('sessionName'))) . '" />
';
    }
开发者ID:Umz,项目名称:ImpressPages,代码行数:14,代码来源:Antispam.php


示例4: getConnection

 /**
  * Get database connection object
  *
  * @throws \Ip\Exception\Db
  * @return \PDO
  */
 public function getConnection()
 {
     if ($this->pdoConnection) {
         return $this->pdoConnection;
     }
     $dbConfig = ipConfig()->get('db');
     ipConfig()->set('db', null);
     if (empty($dbConfig)) {
         throw new \Ip\Exception\Db("Can't connect to database. No connection config found or \\Ip\\Db::disconnect() has been used.");
     }
     try {
         if (array_key_exists('driver', $dbConfig) && $dbConfig['driver'] == 'sqlite') {
             $dsn = 'sqlite:' . $dbConfig['database'];
             $this->pdoConnection = new \PDO($dsn);
             $this->pdoConnection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
         } else {
             $dsn = 'mysql:host=' . str_replace(':', ';port=', $dbConfig['hostname']);
             if (!empty($dbConfig['database'])) {
                 $dsn .= ';dbname=' . $dbConfig['database'];
             }
             $this->pdoConnection = new \PDO($dsn, $dbConfig['username'], $dbConfig['password']);
             $this->pdoConnection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
             $dt = new \DateTime();
             $offset = $dt->format("P");
             $this->pdoConnection->exec("SET time_zone='{$offset}';");
             $this->pdoConnection->exec("SET CHARACTER SET " . $dbConfig['charset']);
         }
     } catch (\PDOException $e) {
         throw new \Ip\Exception\Db("Can't connect to database. Stack trace hidden for security reasons");
         //PHP traces all details of error including DB password. This could be a disaster on live server. So we hide that data.
     }
     $this->tablePrefix = $dbConfig['tablePrefix'];
     return $this->pdoConnection;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:40,代码来源:Db.php


示例5: ipRelativeDir

 /**
  * @ignore
  * @param int $callLevel
  * @return string
  * @throws \Ip\Exception
  */
 public static function ipRelativeDir($callLevel = 0)
 {
     $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $callLevel + 1);
     if (!isset($backtrace[$callLevel]['file'])) {
         throw new \Ip\Exception("Can't find caller");
     }
     $absoluteFile = $backtrace[$callLevel]['file'];
     if (DIRECTORY_SEPARATOR == '\\') {
         // Replace windows paths
         $absoluteFile = str_replace('\\', '/', $absoluteFile);
     }
     $overrides = ipConfig()->get('fileOverrides');
     if ($overrides) {
         foreach ($overrides as $relativePath => $fullPath) {
             if (DIRECTORY_SEPARATOR == '\\') {
                 // Replace windows paths
                 $fullPath = str_replace('\\', '/', $fullPath);
             }
             if (strpos($absoluteFile, $fullPath) === 0) {
                 $relativeFile = substr_replace($absoluteFile, $relativePath, 0, strlen($fullPath));
                 return substr($relativeFile, 0, strrpos($relativeFile, '/') + 1);
             }
         }
     }
     $baseDir = ipConfig()->get('baseDir');
     $baseDir = str_replace('\\', '/', $baseDir);
     if (strpos($absoluteFile, $baseDir) !== 0) {
         throw new \Ip\Exception('Cannot find relative path for file ' . esc($absoluteFile));
     }
     $relativeFile = substr($absoluteFile, strlen($baseDir) + 1);
     return substr($relativeFile, 0, strrpos($relativeFile, '/') + 1);
 }
开发者ID:impresspages,项目名称:impresspages,代码行数:38,代码来源:PathHelper.php


示例6: activate

 public function activate()
 {
     $table = ipTable('comments');
     $sql = "\n        CREATE TABLE IF NOT EXISTS\n           " . $table . "\n        (\n\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t  `language_id` int(11) NOT NULL,\n\t\t  `zone_name` varchar(255) NOT NULL,\n\t\t  `user_id` int(11) DEFAULT NULL,\n\t\t  `name` varchar(255) NOT NULL,\n\t\t  `email` varchar(255) DEFAULT NULL,\n\t\t  `link` varchar(255) DEFAULT NULL,\n\t\t  `text` text NOT NULL,\n\t\t  `ip` varchar(39) NOT NULL,\n\t\t  `approved` tinyint(1) NOT NULL,\n\t\t  `session_id` varchar(255) NOT NULL,\n\t\t  `verification_code` varchar(32) NOT NULL,\n\t\t  `active` tinyint(1) DEFAULT 0,\n\t\t  PRIMARY KEY (`id`),\n\t\t  KEY `user_id` (`user_id`)\n        )";
     ipDb()->execute($sql);
     //add title column if not exist
     $checkSql = "\n        SELECT\n          *\n        FROM\n          information_schema.COLUMNS\n        WHERE\n            TABLE_SCHEMA = :database\n            AND TABLE_NAME = :table\n            AND COLUMN_NAME = :column\n        ";
     $result = ipDb()->fetchAll($checkSql, array('database' => ipConfig()->database(), 'table' => ipConfig()->tablePrefix() . 'comments', 'column' => 'createdAt'));
     if (!$result) {
         $sql = "ALTER TABLE {$table} ADD `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP;";
         ipDb()->execute($sql);
     }
     $result = ipDb()->fetchAll($checkSql, array('database' => ipConfig()->database(), 'table' => ipConfig()->tablePrefix() . 'comments', 'column' => 'modifiedAt'));
     if (!$result) {
         $sql = "ALTER TABLE {$table} ADD `modifiedAt` timestamp NULL DEFAULT NULL;";
         ipDb()->execute($sql);
     }
     $result = ipDb()->fetchAll($checkSql, array('database' => ipConfig()->database(), 'table' => ipConfig()->tablePrefix() . 'comments', 'column' => 'lastActiveAt'));
     if (!$result) {
         $sql = "ALTER TABLE {$table} ADD `lastActiveAt` timestamp NULL DEFAULT NULL;";
         ipDb()->execute($sql);
     }
     $result = ipDb()->fetchAll($checkSql, array('database' => ipConfig()->database(), 'table' => ipConfig()->tablePrefix() . 'comments', 'column' => 'isDeleted'));
     if (!$result) {
         $sql = "ALTER TABLE {$table} ADD `isDeleted` INT(1) NOT NULL DEFAULT 0;";
         ipDb()->execute($sql);
     }
     $result = ipDb()->fetchAll($checkSql, array('database' => ipConfig()->database(), 'table' => ipConfig()->tablePrefix() . 'comments', 'column' => 'deletedAt'));
     if (!$result) {
         $sql = "ALTER TABLE {$table} ADD `deletedAt` timestamp NULL DEFAULT NULL;";
         ipDb()->execute($sql);
     }
     $result = ipDb()->fetchAll($checkSql, array('database' => ipConfig()->database(), 'table' => ipConfig()->tablePrefix() . 'comments', 'column' => 'isVerified'));
     if (!$result) {
         $sql = "ALTER TABLE {$table} ADD `isVerified` timestamp NULL DEFAULT NULL;";
         ipDb()->execute($sql);
     }
     $result = ipDb()->fetchAll($checkSql, array('database' => ipConfig()->database(), 'table' => ipConfig()->tablePrefix() . 'comments', 'column' => 'verifiedAt'));
     if (!$result) {
         $sql = "ALTER TABLE {$table} ADD `verifiedAt` timestamp NULL DEFAULT NULL;";
         ipDb()->execute($sql);
     }
     try {
         ipDb()->execute("DROP INDEX `language_id` ON {$table} ");
     } catch (\Exception $e) {
         //ignore. We don't care if index doesn't exist. We will create it over again
     }
     try {
         ipDb()->execute("DROP INDEX `zone_name` ON {$table} ");
     } catch (\Exception $e) {
         //ignore. We don't care if index doesn't exist. We will create it over again
     }
     try {
         ipDb()->execute("DROP INDEX `page_id` ON {$table} ");
     } catch (\Exception $e) {
         //ignore. We don't care if index doesn't exist. We will create it over again
     }
     ipDb()->execute("ALTER TABLE {$table} ADD KEY `language_id` (`language_id`) ");
     ipDb()->execute("ALTER TABLE {$table} ADD KEY `zone_name` (`zone_name`) ");
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:60,代码来源:Worker.php


示例7: index

 public function index()
 {
     ipAddJsVariable('ipTranslationAreYouSure', __('Are you sure?', 'Ip-admin', false));
     ipAddJs('Ip/Internal/Core/assets/js/angular.js');
     ipAddJs('Ip/Internal/Pages/assets/js/pages.js');
     ipAddJs('Ip/Internal/Pages/assets/js/pagesLayout.js');
     ipAddJs('Ip/Internal/Pages/assets/js/menuList.js');
     ipAddJs('Ip/Internal/Pages/assets/jstree/jstree.min.js');
     ipAddJs('Ip/Internal/Pages/assets/js/jquery.pageTree.js');
     ipAddJs('Ip/Internal/Pages/assets/js/jquery.pageProperties.js');
     ipAddJs('Ip/Internal/Grid/assets/grid.js');
     ipAddJs('Ip/Internal/Grid/assets/gridInit.js');
     ipAddJs('Ip/Internal/Grid/assets/subgridField.js');
     ipAddJsVariable('languageList', Helper::languageList());
     ipAddJsVariable('ipPagesLanguagesPermission', ipAdminPermission('Languages'));
     $menus = Model::getMenuList();
     foreach ($menus as $key => &$menu) {
         $default = 'top';
         if ($key == 0) {
             $default = 'bottom';
         }
         $menu['defaultPosition'] = Model::getDefaultMenuPagePosition($menu['alias'], false, $default);
         $default = 'below';
         $menu['defaultPositionWhenSelected'] = Model::getDefaultMenuPagePosition($menu['alias'], true, $default);
     }
     $menus = ipFilter('ipPagesMenuList', $menus);
     ipAddJsVariable('menuList', $menus);
     $variables = array('addPageForm' => Helper::addPageForm(), 'addMenuForm' => Helper::addMenuForm(), 'languagesUrl' => ipConfig()->baseUrl() . '?aa=Languages.index');
     $layout = ipView('view/layout.php', $variables);
     ipResponse()->setLayoutVariable('removeAdminContentWrapper', true);
     ipAddJsVariable('listStylePageSize', ipGetOption('Pages.pageListSize', 30));
     return $layout->render();
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:33,代码来源:AdminController.php


示例8: ipBeforeController

 public static function ipBeforeController()
 {
     $request = \Ip\ServiceLocator::request();
     $sessionLifetime = ini_get('session.gc_maxlifetime');
     if (!$sessionLifetime) {
         $sessionLifetime = 120;
     }
     if ($sessionLifetime > 30) {
         $sessionLifetime = $sessionLifetime - 20;
     }
     ipAddJsVariable('ipSessionRefresh', $sessionLifetime);
     if (ipConfig()->isDebugMode()) {
         ipAddJs('Ip/Internal/Core/assets/ipCore/jquery.js', null, 10);
         // default, global jQuery
         ipAddJs('Ip/Internal/Core/assets/ipCore/console.log.js', null, 10);
         ipAddJs('Ip/Internal/Core/assets/ipCore/functions.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/jquery.tools.form.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/form/color.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/form/file.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/form/richtext.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/form/repositoryFile.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/form/url.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/form.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/validator.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/widgets.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/ipCore.js');
     } else {
         ipAddJs('Ip/Internal/Core/assets/ipCore.min.js', null, 10);
     }
     //Form init
     $validatorTranslations = array('Ip-admin' => static::validatorLocalizationData('Ip-admin'), ipContent()->getCurrentLanguage()->getCode() => static::validatorLocalizationData('Ip'));
     ipAddJsVariable('ipValidatorTranslations', $validatorTranslations);
     if (ipAdminId() || \Ip\Internal\Admin\Model::isLoginPage() || \Ip\Internal\Admin\Model::isPasswordResetPage()) {
         if (ipConfig()->isDebugMode()) {
             ipAddJs('Ip/Internal/Core/assets/admin/managementMode.js');
             ipAddJs('Ip/Internal/Core/assets/admin/functions.js');
             ipAddJs('Ip/Internal/Core/assets/admin/validator.js');
             ipAddJs('Ip/Internal/Core/assets/admin/bootstrap/bootstrap.js');
             ipAddJs('Ip/Internal/Core/assets/admin/bootstrap-switch/bootstrap-switch.js');
         } else {
             ipAddJs('Ip/Internal/Core/assets/admin.min.js', null, 10);
         }
         ipAddJs('Ip/Internal/Core/assets/tinymce/pastePreprocess.js');
         ipAddJs('Ip/Internal/Core/assets/tinymce/default.js');
     }
     if (ipAdminId()) {
         ipAddJs('Ip/Internal/Core/assets/js/tiny_mce/jquery.tinymce.min.js');
         ipAddJs('Ip/Internal/Core/assets/js/tiny_mce/tinymce.min.js');
         ipAddJsVariable('ipBrowseLinkModalTemplate', ipView('view/browseLinkModal.php')->render());
         ipAddJs('Ip/Internal/Core/assets/ipCore/plupload/plupload.full.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/plupload/plupload.browserplus.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/plupload/plupload.gears.js');
         ipAddJs('Ip/Internal/Core/assets/ipCore/plupload/jquery.plupload.queue/jquery.plupload.queue.js');
         if (is_file(ipThemeFile('setup/admin.js'))) {
             ipAddJs(ipThemeUrl('setup/admin.js'));
         }
         ipAddCss('Ip/Internal/Core/assets/admin/admin.css');
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:59,代码来源:Event.php


示例9: domain

 public static function domain()
 {
     $domain = ipGetOption('GoogleAnalytics.domain');
     if (empty($domain)) {
         $domain = parse_url(ipConfig()->baseUrl(), PHP_URL_HOST);
     }
     return $domain;
 }
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:8,代码来源:Config.php


示例10: getLanguageSelectForm

 public static function getLanguageSelectForm()
 {
     //create form object
     $form = new \Ip\Form();
     $form->setEnvironment(\Ip\Form::ENVIRONMENT_ADMIN);
     $form->addClass('ipsLanguageSelect');
     //add text field to form object
     $field = new \Ip\Form\Field\Select(array('name' => 'languageCode', 'values' => self::getAvailableLocales()));
     $field->setValue(ipConfig()->adminLocale());
     $form->addfield($field);
     return $form;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:12,代码来源:FormHelper.php


示例11: getTheme

 public function getTheme($name = null, $dir = null, $url = null)
 {
     if ($name == null) {
         $name = ipConfig()->theme();
     }
     if ($dir == null) {
         $dir = ipFile('Theme/');
     }
     $model = Model::instance();
     $theme = $model->getTheme($name, $dir, $url);
     return $theme;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:12,代码来源:Service.php


示例12: index

 /**
  * Index action adds an item to administration menu
  */
 public function index()
 {
     ipAddJs('view/assets/js/vendor/angular.js', 1);
     ipAddJs('view/assets/js/vendor/angular-animate.min.js');
     ipAddJs('view/assets/js/vendor/angular-sanitize.min.js');
     ipAddJs('view/assets/js/vendor/ngToast.min.js');
     ipAddJs('view/assets/js/Controllers/WidgetCtrl.js', 6);
     ipAddCss('view/assets/css/ngToast.min.css');
     $BasePath = ipConfig()->baseUrl();
     ipAddJsVariable('BASEPATH', $BasePath);
     $data = array();
     return ipView('view/main.php', $data)->render();
 }
开发者ID:Gioni06,项目名称:controllerRedirectPlugin,代码行数:16,代码来源:AdminController.php


示例13: ipErrorHandler

 public static function ipErrorHandler($errno, $errstr, $errfile, $errline)
 {
     set_error_handler(__CLASS__ . '::ipSilentErrorHandler');
     $type = '';
     switch ($errno) {
         case E_USER_WARNING:
             $type .= 'Warning';
             break;
         case E_USER_NOTICE:
             $type .= 'Notice';
             break;
         case E_WARNING:
             $type .= 'Warning';
             break;
         case E_NOTICE:
             $type .= 'Notice';
             break;
         case E_CORE_WARNING:
             $type .= 'Warning';
             break;
         case E_COMPILE_WARNING:
             $type .= 'Warning';
             break;
         case E_USER_ERROR:
             $type .= 'Error';
             break;
         case E_ERROR:
             $type .= 'Error';
             break;
         case E_PARSE:
             $type .= 'Parse';
             break;
         case E_CORE_ERROR:
             $type .= 'Error';
             break;
         case E_COMPILE_ERROR:
             $type .= 'Error';
             break;
         default:
             $type .= 'Unknown exception';
             break;
     }
     if (class_exists('Ip\\Internal\\Log\\Logger')) {
         ipLog()->error($type . ': ' . $errstr . ' in {file}:{line}', array('file' => $errfile, 'line' => $errline));
     }
     if (ipConfig()->showErrors()) {
         echo "{$errstr} in {$errfile}:{$errline}";
     }
     restore_error_handler();
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:50,代码来源:ErrorHandler.php


示例14: initManagement

 public static function initManagement()
 {
     $widgets = Service::getAvailableWidgets();
     $snippets = array();
     foreach ($widgets as $widget) {
         $snippetHtml = $widget->adminHtmlSnippet();
         if ($snippetHtml != '') {
             $snippets[] = $snippetHtml;
         }
     }
     ipAddJsVariable('ipWidgetSnippets', $snippets);
     ipAddJsVariable('ipContentInit', Model::initManagementData());
     ipAddJs('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.js');
     ipAddCss('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.css');
     if (ipConfig()->isDebugMode()) {
         ipAddJs('Ip/Internal/Content/assets/management/ipContentManagementInit.js');
         ipAddJs('Ip/Internal/Content/assets/management/content.js');
         ipAddJs('Ip/Internal/Content/assets/management/jquery.ip.contentManagement.js');
         ipAddJs('Ip/Internal/Content/assets/management/jquery.ip.widgetbutton.js');
         ipAddJs('Ip/Internal/Content/assets/management/jquery.ip.layoutModal.js');
         ipAddJs('Ip/Internal/Content/assets/management/jquery.ip.block.js');
         ipAddJs('Ip/Internal/Content/assets/management/jquery.ip.widget.js');
         ipAddJs('Ip/Internal/Content/assets/management/exampleContent.js');
         ipAddJs('Ip/Internal/Content/assets/management/drag.js');
         ipAddJs('Ip/Internal/Content/Widget/Columns/assets/Columns.js');
         ipAddJs('Ip/Internal/Content/Widget/File/assets/File.js');
         ipAddJs('Ip/Internal/Content/Widget/File/assets/jquery.ipWidgetFile.js');
         ipAddJs('Ip/Internal/Content/Widget/File/assets/jquery.ipWidgetFileContainer.js');
         ipAddJs('Ip/Internal/Content/Widget/Form/assets/Form.js');
         ipAddJs('Ip/Internal/Content/Widget/Form/assets/FormContainer.js');
         ipAddJs('Ip/Internal/Content/Widget/Form/assets/FormField.js');
         ipAddJs('Ip/Internal/Content/Widget/Form/assets/FormOptions.js');
         ipAddJs('Ip/Internal/Content/Widget/Html/assets/Html.js');
         ipAddJs('Ip/Internal/Content/Widget/Video/assets/Video.js');
         ipAddJs('Ip/Internal/Content/Widget/Image/assets/Image.js');
         ipAddJs('Ip/Internal/Content/Widget/Gallery/assets/Gallery.js');
         ipAddJs('Ip/Internal/Content/Widget/Text/assets/Text.js');
         ipAddJs('Ip/Internal/Content/Widget/Heading/assets/Heading.js');
         ipAddJs('Ip/Internal/Content/Widget/Heading/assets/HeadingModal.js');
         ipAddJs('Ip/Internal/Content/Widget/Map/assets/Map.js');
     } else {
         ipAddJs('Ip/Internal/Content/assets/management.min.js');
     }
     ipAddJs('Ip/Internal/Core/assets/js/jquery-tools/jquery.tools.ui.scrollable.js');
     ipAddJs('Ip/Internal/Content/assets/jquery.ip.uploadImage.js');
     ipAddJsVariable('isMobile', \Ip\Internal\Browser::isMobile());
     ipAddJsVariable('ipWidgetLayoutModalTemplate', ipView('view/widgetLayoutModal.php')->render());
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:48,代码来源:Helper.php


示例15: generateJavascript

 public function generateJavascript()
 {
     $cacheVersion = $this->getCacheVersion();
     $javascriptFiles = $this->getJavascript();
     $javascriptFilesSorted = array();
     foreach ($javascriptFiles as $level) {
         foreach ($level as &$file) {
             if ($file['type'] == 'file' && $file['cacheFix']) {
                 $file['value'] .= (strpos($file['value'], '?') !== false ? '&' : '?') . $cacheVersion;
             }
         }
         $javascriptFilesSorted = array_merge($javascriptFilesSorted, $level);
     }
     $data = array('ip' => array('baseUrl' => ipConfig()->baseUrl(), 'languageId' => null, 'languageUrl' => '', 'theme' => ipConfig()->get('theme'), 'pageId' => null, 'securityToken' => \Ip\ServiceLocator::application()->getSecurityToken(), 'developmentEnvironment' => ipConfig()->isDevelopmentEnvironment(), 'debugMode' => ipconfig()->isDebugMode(), 'isManagementState' => false, 'isAdminState' => false, 'isAdminNavbarDisabled' => false), 'javascriptVariables' => $this->getJavascriptVariables(), 'javascript' => $javascriptFilesSorted);
     return ipView(ipFile('Ip/Internal/Config/view/javascript.php'), $data)->render();
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:16,代码来源:PageAssets.php


示例16: getReflection

 /**
  * @param string $file relative path from file/repository
  * @param array $options - image cropping options
  * @param string $desiredName - desired file name. If reflection is missing, service will try to create new one with name as possible similar to desired
  * @param bool $onDemand transformation will be create on the fly when image accessed for the first time
  * @return string - file name from BASE_DIR
  * @throws \Ip\Exception\Repository\Transform
  */
 public function getReflection($file, $options, $desiredName = null, $onDemand = true)
 {
     $reflectionModel = ReflectionModel::instance();
     try {
         $reflection = $reflectionModel->getReflection($file, $options, $desiredName, $onDemand);
         if (ipConfig()->get('rewritesDisabled') && !is_file(ipFile('file/' . $reflection)) || !ipConfig()->get('realTimeReflections', true)) {
             //create reflections immediately if mod_rewrite is disabled
             $reflectionRecord = $reflectionModel->getReflectionByReflection($reflection);
             $reflectionModel->createReflection($reflectionRecord['original'], $reflectionRecord['reflection'], json_decode($reflectionRecord['options'], true));
         }
     } catch (\Exception $e) {
         ipLog()->error($e->getMessage(), array('errorTrace' => $e->getTraceAsString()));
         $this->lastException = $e;
         return false;
     }
     return 'file/' . $reflection;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:25,代码来源:ReflectionService.php


示例17: error404Message

 /**
  * Find the reason why the user come to non-existent URL
  * @return string error message
  */
 protected function error404Message()
 {
     $message = '';
     if (!isset($_SERVER['HTTP_REFERER']) || $_SERVER['HTTP_REFERER'] == '') {
         //mistyped URL
         $message = __('Sorry, but the page you were trying to get to does not exist.', 'Ip', false);
     } else {
         if (strpos($_SERVER['HTTP_REFERER'], ipConfig()->baseUrl()) < 5 && strpos($_SERVER['HTTP_REFERER'], ipConfig()->baseUrl()) !== false) {
             //Broken internal link
             $message = '<p>' . __('Sorry, but the page you were trying to get to does not exist.', 'Ip') . '</p>';
         } elseif (strpos($_SERVER['HTTP_REFERER'], ipConfig()->baseUrl()) === false) {
             //Broken external link
             $message = '<p>' . __('Sorry, but the page you were trying to get to does not exist.', 'Ip') . '</p>';
         }
     }
     return $message;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:21,代码来源:PageNotFound.php


示例18: __construct

 public function __construct()
 {
     $this->fieldsets = array();
     $this->method = self::METHOD_POST;
     $this->action = ipConfig()->baseUrl();
     $this->attributes = array();
     $this->classes = array();
     $this->ajaxSubmit = true;
     $this->validate = true;
     $this->addClass('ipsAjaxSubmit');
     if (ipRoute()->isAdmin()) {
         $this->setEnvironment(self::ENVIRONMENT_ADMIN);
     } else {
         $this->addClass('ipModuleForm');
         $this->setEnvironment(self::ENVIRONMENT_PUBLIC);
     }
     $this->addCsrfCheck();
     $this->addSpamCheck();
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:19,代码来源:Form.php


示例19: load

 /**
  * load(): defined by FileLoaderInterface.
  *
  * @see    FileLoaderInterface::load()
  * @param  string $locale
  * @param  string $filename
  * @return TextDomain|null
  * @throws Exception\InvalidArgumentException
  */
 public function load($locale, $filename)
 {
     if (!is_file($filename) || !is_readable($filename)) {
         throw new Exception\InvalidArgumentException(sprintf('Could not open file %s for reading', $filename));
     }
     $messages = json_decode(file_get_contents($filename), true);
     if (!is_array($messages)) {
         if (ipConfig()->isDevelopmentEnvironment()) {
             throw new Exception\InvalidArgumentException(sprintf('Expected an array, but received %s', gettype($messages)));
         } else {
             return null;
         }
     }
     $textDomain = new TextDomain($messages);
     if (array_key_exists('', $textDomain)) {
         if (isset($textDomain['']['plural_forms'])) {
             $textDomain->setPluralRule(PluralRule::fromString($textDomain['']['plural_forms']));
         }
         unset($textDomain['']);
     }
     return $textDomain;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:31,代码来源:JsonLoader.php


示例20: getAllConfigValues

 public function getAllConfigValues($theme)
 {
     $data = ipRequest()->getRequest();
     if (isset($data['restoreDefault'])) {
         $config = array();
         //overwrite current config with default theme values
         $model = Model::instance();
         $theme = $model->getTheme(ipConfig()->theme());
         $options = $theme->getOptionsAsArray();
         foreach ($options as $option) {
             if (isset($option['name']) && isset($option['default'])) {
                 $config[$option['name']] = $option['default'];
             }
         }
         return $config;
     } else {
         $config = $this->getLiveConfig();
         if (!empty($config)) {
             return $config;
         }
     }
     return ipThemeStorage($theme)->getAll();
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:23,代码来源:ConfigModel.php



注:本文中的ipConfig函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ipContent函数代码示例发布时间:2022-05-15
下一篇:
PHP ipAddJs函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap