本文整理汇总了PHP中ipContent函数的典型用法代码示例。如果您正苦于以下问题:PHP ipContent函数的具体用法?PHP ipContent怎么用?PHP ipContent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ipContent函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Execute response and return html response
*
* @return \Ip\Response
*/
public function execute()
{
ipContent()->setBlockContent('main', $this->content);
$layout = $this->getLayout();
if ($layout[0] == '/' || $layout[1] == ':') {
// Check if absolute path: '/' for unix, 'C:' for windows
$viewFile = $layout;
if (!is_file($viewFile)) {
$viewFile = ipThemeFile('main.php');
}
} elseif (strpos($layout, '/') !== false) {
//impresspages path. Eg. Ip/Internal/xxx.php
$viewFile = $layout;
if (!is_file(ipFile($viewFile))) {
$viewFile = ipThemeFile('main.php');
}
} else {
//layout file. Like main.php
$viewFile = ipThemeFile($layout);
if (!is_file($viewFile)) {
$viewFile = ipThemeFile('main.php');
}
}
$content = ipView($viewFile, $this->getLayoutVariables())->render();
$response = new \Ip\Response($content, $this->getHeaders(), $this->getStatusCode());
return $response;
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:32,代码来源:Layout.php
示例2: delete
public static function delete($id)
{
ipEvent('ipBeforeLanguageDeleted', array('id' => $id));
ipDb()->delete('language', array('id' => $id));
ipContent()->_invalidateLanguages();
ipEvent('ipLanguageDeleted', array('id' => $id));
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:7,代码来源:Model.php
示例3: getPageId
public static function getPageId()
{
if (!ipContent()->getCurrentPage()) {
return null;
}
return ipContent()->getCurrentPage()->getId();
}
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:7,代码来源:Model.php
示例4: saveValue
public function saveValue()
{
$request = \Ip\ServiceLocator::request();
$request->mustBePost();
$post = $request->getPost();
if (empty($post['fieldName'])) {
throw new \Exception('Missing required parameter');
}
$fieldName = $post['fieldName'];
if (!isset($post['value'])) {
throw new \Exception('Missing required parameter');
}
$value = $post['value'];
if (!in_array($fieldName, array('websiteTitle', 'websiteEmail')) && !(in_array($fieldName, array('automaticCron', 'cronPassword', 'removeOldRevisions', 'removeOldRevisionsDays', 'removeOldEmails', 'removeOldEmailsDays', 'allowAnonymousUploads', 'trailingSlash')) && ipAdminPermission('Config advanced'))) {
throw new \Exception('Unknown config value');
}
$emailValidator = new \Ip\Form\Validator\Email();
$error = $emailValidator->getError(array('value' => $value), 'value', \Ip\Form::ENVIRONMENT_ADMIN);
if ($fieldName === 'websiteEmail' && $error !== false) {
return $this->returnError($error);
}
if (in_array($fieldName, array('websiteTitle', 'websiteEmail'))) {
if (!isset($post['languageId'])) {
throw new \Exception('Missing required parameter');
}
$languageId = $post['languageId'];
$language = ipContent()->getLanguage($languageId);
ipSetOptionLang('Config.' . $fieldName, $value, $language->getCode());
} else {
ipSetOption('Config.' . $fieldName, $value);
}
return new \Ip\Response\Json(array(1));
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:33,代码来源:AdminController.php
示例5: sendMailNotification
public static function sendMailNotification($page, $author, $date, $comm, $emailAuthor, $pageTitle = '', $vcode = '')
{
$sendEmail = ipGetOption('Comment.useSeparateEmail');
if (empty($sendEmail)) {
$sendEmail = ipGetOptionLang('Config.websiteEmail');
}
$noUser = '<br /><div>' . __("You are not a registered user, or pehaps you were not logged in when have commented. So, you need to verify " . "your email address before your comment is moderated and published. Please, click on the following link for " . "such a thing: ", "Comments") . '<a href="' . ipHomeUrl() . ipContent()->getCurrentLanguage()->getUrlPath() . 'comments/' . $vcode . '-!' . $emailAuthor . '">' . __('Email verification', 'Comments') . '</a>' . __(" If it doesn't work, please copy and past the following in your web browser: ", "Comments") . "<strong>" . ipHomeUrl() . ipContent()->getCurrentLanguage()->getUrlPath() . "comments/" . $vcode . '-!' . $emailAuthor . '</strong></div><br />';
if (ipUser()->isLoggedIn()) {
$noUser = '';
}
//array can has: 'title', 'content', 'signature', 'footer'.
$contentAdmin = sprintf('<div><strong>' . __('Page', 'Comments') . ':</strong> ' . __($pageTitle, 'Comments') . ' (%s)</div>' . '<div><strong>' . __('Author', 'Comments') . ':</strong> %s - ' . $emailAuthor . '</div>' . '<div><strong>' . __('Date', 'Comments') . ':</strong> %s</div>' . '<div><strong>' . __('Comment', 'Comments') . ':</strong></div>' . '<div><cite class="mail">%s</cite></div>', $page, $author, $date, $comm);
$templateAdmin = array('title' => __('You just received a comment', 'Comments'), 'content' => $contentAdmin, 'signature' => '<h4>' . __('Internal Administration', 'Comments') . '</h4>', 'footer' => '<h4>' . ipGetOptionLang('Config.websiteTitle') . '</h4>');
$contentAuthor = sprintf(__('Your comment has been sent and it is awaiting moderation. Thank you.', 'Comments') . $noUser . '<div><strong>' . __('Page', 'Comments') . ':</strong> ' . __($pageTitle, 'Comments') . ' (%s)</div>' . '<div><strong>' . __('Author', 'Comments') . ':</strong> %s - ' . $emailAuthor . '</div>' . '<div><strong>' . __('Date', 'Comments') . ':</strong> %s</div>' . '<div><strong>' . __('Comment', 'Comments') . ':</strong></div>' . '<div><cite class="mail">%s</cite></div>', $page, $author, $date, $comm);
$templateAuthor = array('title' => __('You just sent a comment', 'Comments'), 'content' => $contentAuthor, 'signature' => '<div>' . __('Kindest regards', 'Comments') . ',</div>', 'footer' => '<h4>' . ipGetOptionLang('Config.websiteTitle') . '</h4>');
/* ipSendEmail ( string $from , string $fromName , string $to ,
string $toName , string $subject , string $content , [ boolean $urgent ] ,
[ boolean $html ] , [ string|array|null $files ] ) */
if (ipGetOption('Comments.informAboutNewComments') == 'Yes') {
//ipSendEmail() Administration
ipSendEmail($sendEmail, __('Site Comment', 'Comments'), $sendEmail, __('Comment Moderation', 'Comments'), __('There is a new comment', 'Comments') . ': ' . __($pageTitle, 'Comments'), ipEmailTemplate($templateAdmin), true, true);
}
if (ipGetOption('Comments.requireEmailConfirmation') == 'Yes') {
//ipSendMail Author
ipSendEmail($sendEmail, ipGetOptionLang('Config.websiteTitle'), $emailAuthor, $author, __('You have just done a comment in our website', 'Comments') . ': ' . __($pageTitle, 'Comments'), ipEmailTemplate($templateAuthor), true, true);
}
}
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:27,代码来源:Helper.php
示例6: render
public function render($doctype, $environment)
{
$languages = ipContent()->getLanguages();
$answer = '';
foreach ($languages as $language) {
$langValue = '';
$fieldValue = $this->getValue();
if (is_array($fieldValue)) {
if (!empty($fieldValue[$language->getCode()])) {
$langValue = $fieldValue[$language->getCode()];
}
}
if (!is_string($langValue)) {
//just in case we have an array or something else incompatible with below code in the database
$langValue = '';
}
$answer .= '
<div class="input-group">
<span class="input-group-addon">' . esc($language->getAbbreviation()) . '</span>
<input ' . $this->getAttributesStr($doctype) . ' class="form-control ' . implode(' ', $this->getClasses()) . '" name="' . escAttr($this->getName() . '[' . $language->getCode() . ']" ') . $this->getValidationAttributesStr($doctype) . ' type="text" value="' . escAttr($langValue) . '" />
</div>
';
}
return $answer;
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:25,代码来源:TextLang.php
示例7: 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
示例8: ipExecuteController
/**
* @param $info
* @return \Ip\Response\Redirect
*/
public static function ipExecuteController($info)
{
$page = ipContent()->getCurrentPage();
if ($page && $page->getRedirectUrl() && !ipAdminId()) {
return new \Ip\Response\Redirect($page->getRedirectUrl());
}
return null;
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:12,代码来源:Job.php
示例9: languageList
public static function languageList()
{
$answer = array();
$languages = ipContent()->getLanguages();
foreach ($languages as $language) {
$answer[] = array('id' => $language->getId(), 'title' => $language->getTitle(), 'abbreviation' => $language->getAbbreviation(), 'code' => $language->getCode());
}
return $answer;
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:9,代码来源:Helper.php
示例10: activate
/**
* @throws \Ip\Exception\Db
*/
public function activate()
{
$savedTableTypes = ipGetOption(TableType::OPTION);
if (empty($savedTableTypes)) {
ipSetOption(TableType::OPTION, array());
TableType::create(array('name' => 'default', 'language' => ipContent()->getLanguages()[0]->getId(), 'columnOption' => TableType::SHOW_ALL_COLUMNS, 'specificColumns' => array()))->save();
}
$this->createDataTableRepository();
}
开发者ID:hmuralt,项目名称:DataTableWidget,代码行数:12,代码来源:Worker.php
示例11: ipBeforeLanguageDeleted
public static function ipBeforeLanguageDeleted($data)
{
$languageId = $data['id'];
$language = ipContent()->getLanguage($languageId);
$menus = Service::getMenus($language->getCode());
foreach ($menus as $menu) {
Service::deletePage($menu['id']);
}
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:9,代码来源:Event.php
示例12: pageNotFound
public function pageNotFound()
{
$content = null;
$error404Page = ipContent()->getPageByAlias('error404');
if ($error404Page) {
$revision = \Ip\Internal\Revision::getPublishedRevision($error404Page->getId());
$content = \Ip\Internal\Content\Model::generateBlock('main', $revision['revisionId'], 0, 0);
}
return new \Ip\Response\PageNotFound($content);
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:10,代码来源:PublicController.php
示例13: pagePassword
public static function pagePassword($pageId = null)
{
if ($pageId === null) {
if (!ipContent()->getCurrentPage()) {
return null;
}
$pageId = ipContent()->getCurrentPage()->getId();
}
return Model::getPagePassword($pageId);
}
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:10,代码来源:Service.php
示例14: index
/**
* @ipSubmenu Table types
*/
public function index()
{
ipAddJs('Ip/Internal/Core/assets/js/angular.js');
ipAddJs('Plugin/DataTableWidget/assets/tableTypesController.js');
$data = array('createForm' => AdminFormHelper::createForm(true), 'updateForm' => AdminFormHelper::updateForm(true), 'deleteForm' => AdminFormHelper::deleteForm());
ipAddJsVariable('tableTypes', TableType::getAllAsArray());
ipAddJsVariable('columnOptions', TableType::getColumnOptions());
ipAddJsVariable('languages', ipContent()->getLanguages());
return ipView('view/layout.php', $data)->render();
}
开发者ID:hmuralt,项目名称:DataTableWidget,代码行数:13,代码来源:AdminController.php
示例15: ipLanguageAdded
public static function ipLanguageAdded($data)
{
$language = ipContent()->getLanguage($data['id']);
$languages = ipContent()->getLanguages();
$firstLanguage = $languages[0];
$title = ipGetOptionLang('Config.websiteTitle', $firstLanguage->getCode());
$email = ipGetOptionLang('Config.websiteEmail', $firstLanguage->getCode());
ipSetOptionLang('Config.websiteTitle', $title, $language->getCode());
ipSetOptionLang('Config.websiteEmail', $email, $language->getCode());
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:10,代码来源:Event.php
示例16: facebookTags
public static function facebookTags($pageId = null)
{
if ($pageId === null) {
$currentPage = ipContent()->getCurrentPage();
if (!$currentPage) {
return array();
}
$pageId = $currentPage->getId();
}
return Model::getFacebookTags($pageId);
}
开发者ID:impresspages-plugins,项目名称:FacebookTags,代码行数:11,代码来源:Service.php
示例17: comments
public function comments()
{
$langs = ipContent()->getLanguages();
$langs_values = array();
if (!empty($langs)) {
foreach ($langs as $key => $val) {
$langs_values[] = array($val->getId(), $val->getTitle());
}
}
$config = array('title' => __('Comments', 'Comments'), 'table' => 'comments', 'deleteWarning' => __('Do you really want to delete this item?', 'Comments'), 'sortField' => 'createdAt', 'sortDirection' => 'desc', 'createPosition' => 'top', 'pageSize' => 6, 'fields' => array(array('label' => __('Page I', 'ClassesEnroll'), 'type' => 'Tab'), array('label' => __('Page', 'Comments'), 'field' => 'zone_name', 'validators' => array('Required')), array('label' => __('User Id', 'Comments'), 'field' => 'user_id', 'preview' => false), array('label' => __('Name', 'Comments'), 'field' => 'name', 'validators' => array('Required')), array('label' => __('Email', 'Comments'), 'field' => 'email', 'validators' => array('Required', 'Email')), array('label' => __('Page II', 'ClassesEnroll'), 'type' => 'Tab'), array('label' => __('Link', 'Comments'), 'field' => 'link', 'preview' => false), array('type' => 'Textarea', 'label' => __('Comment', 'Comments'), 'field' => 'text', 'validators' => array('Required'), 'preview' => false), array('label' => __('IP', 'Comments'), 'field' => 'ip', 'validators' => array('Required'), 'preview' => false), array('label' => __('Modified at', 'Comments'), 'field' => 'modifiedAt', 'allowCreate' => false, 'allowUpdate' => true, 'preview' => false, 'transformations' => array('\\Plugin\\Comments\\Transformation\\MySqlTimestampNow')), array('label' => __('Page III', 'ClassesEnroll'), 'type' => 'Tab'), array('type' => 'Select', 'label' => __('Approved', 'Comments'), 'field' => 'approved', 'values' => array(array('0', 'No'), array('1', 'Yes')), 'validators' => array('Required')), array('label' => __('Session', 'Comments'), 'field' => 'session_id', 'validators' => array('Required'), 'allowCreate' => true, 'allowUpdate' => false, 'defaultValue' => '1-internal', 'preview' => false), array('label' => __('Verification Code', 'Comments'), 'field' => 'verification_code', 'validators' => array('Required'), 'allowCreate' => true, 'allowUpdate' => false, 'defaultValue' => '1-internal', 'preview' => false), array('type' => 'Select', 'label' => __('Active', 'Comments'), 'field' => 'active', 'values' => array(array('0', 'No'), array('1', 'Yes')), 'validators' => array('Required')), array('type' => 'Select', 'label' => __('Language', 'Comments'), 'field' => 'language_id', 'values' => $langs_values, 'validators' => array('Required'), 'preview' => false)));
$config = ipFilter('Comments_commentsConfig', $config);
return ipGridController($config);
}
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:13,代码来源:AdminController.php
示例18: showComments_10
public static function showComments_10()
{
$lang = ipContent()->getCurrentLanguage();
$page = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$page = 'http://' . parse_url($page, PHP_URL_HOST) . parse_url($page, PHP_URL_PATH);
//echo parse_url($page, PHP_URL_HOST)."<br>";
//echo parse_url($page, PHP_URL_PATH)."<br>"; // 4 lines debug finality
//echo parse_url($page, PHP_URL_QUERY);
//echo $page;
$items = ipDb()->selectAll('comments', '*', array('language_id' => $lang->getId(), 'zone_name' => $page, 'approved' => '1', 'active' => '1'), 'ORDER BY `createdAt` desc');
$helperData = array('items' => $items);
return ipView('view/commentView.php', $helperData)->render();
}
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:13,代码来源:Slot.php
示例19: ipBeforeResponseSent
public static function ipBeforeResponseSent($response)
{
$page = ipContent()->getCurrentPage();
if ($page) {
$rawCode = Model::getRawCode($page->getId());
if ($rawCode) {
// ob_start();
eval($rawCode);
// $content = ob_get_contents();
// ob_end_clean();
}
}
}
开发者ID:sspaeti,项目名称:ImpressPages,代码行数:13,代码来源:Event.php
示例20: getValue
/**
* Get value
*
* @param string $key
* @param int $languageId
* @param int $pageId
* @return Entity\Scope
*/
public function getValue($key, $languageId, $pageId)
{
// Find value in breadcrumb.
if ($pageId === null) {
// We can't get breadcrumb if page id is null.
$breadcrumb = array();
} else {
$breadcrumb = ipContent()->getBreadcrumb($pageId);
// var_dump($breadcrumb);
// exit;
}
$breadcrumb = array_reverse($breadcrumb);
foreach ($breadcrumb as $position => $element) {
$value = $this->getPageValue($key, $languageId, $element->getId());
if ($value) {
if ($position == 0) {
$scope = new Entity\Scope();
$scope->settype(Entity\Scope::SCOPE_PAGE);
$scope->setPageId($element->getId());
$scope->setLanguageId($languageId);
$this->lastValueScope = $scope;
} else {
$scope = new Entity\Scope();
$scope->settype(Entity\Scope::SCOPE_PARENT_PAGE);
$scope->setPageId($element->getId());
$scope->setLanguageId($languageId);
$this->lastValueScope = $scope;
}
return $value;
}
}
// Find language value.
$value = $this->getLanguageValue($key, $languageId);
if ($value !== false) {
$scope = new Entity\Scope();
$scope->settype(Entity\Scope::SCOPE_LANGUAGE);
$scope->setLanguageId($languageId);
$this->lastValueScope = $scope;
return $value;
}
// Find global value.
$value = $this->getGlobalValue($key);
if ($value !== false) {
$scope = new Entity\Scope();
$scope->settype(Entity\Scope::SCOPE_GLOBAL);
$this->lastValueScope = $scope;
return $value;
}
$this->lastValueScope = false;
return false;
}
开发者ID:Umz,项目名称:ImpressPages,代码行数:59,代码来源:Dao.php
注:本文中的ipContent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论