本文整理汇总了PHP中ipIsManagementState函数的典型用法代码示例。如果您正苦于以下问题:PHP ipIsManagementState函数的具体用法?PHP ipIsManagementState怎么用?PHP ipIsManagementState使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ipIsManagementState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateHtml
public function generateHtml($revisionId, $widgetId, $data, $skin)
{
if (!$this->gmapsApiAvailable()) {
if (ipIsManagementState()) {
return '<div class="note"><a href="' . ipActionUrl(array('aa' => 'Config')) . '">' . __("Maps widget is based on Google Maps. Please set up Google Maps API key to make it work.", 'Ip-admin') . '</a></div>';
} else {
//don't show anything on public site
return '';
}
}
if (!empty($data['height'])) {
$data['height'] = (int) $data['height'] . 'px';
} else {
$data['height'] = '250px';
}
if (empty($data['mapTypeId'])) {
$data['mapTypeId'] = null;
}
if (empty($data['zoom'])) {
$data['zoom'] = null;
}
if (empty($data['lat'])) {
$data['lat'] = null;
}
if (empty($data['lng'])) {
$data['lng'] = null;
}
return parent::generateHtml($revisionId, $widgetId, $data, $skin);
}
示例2: generateHtml
public function generateHtml($revisionId, $widgetId, $data, $skin)
{
if (ipIsManagementState()) {
return parent::generateHtml($revisionId, $widgetId, $data, $skin);
} else {
return '';
}
}
示例3: generateVideoHtml
protected function generateVideoHtml($data)
{
if (empty($data['url'])) {
return false;
}
$url = $data['url'];
if (preg_match('%^[^"&?/ ]{11}$%i', $url)) {
//youtube id
$url = 'http://www.youtube.com/embed/' . $url;
}
if (preg_match('%^[0-9]+$%i', $url)) {
//vimeo id
$url = 'http://player.vimeo.com/video/' . $url;
}
if (!preg_match('/^((http|https):\\/\\/)/i', $url)) {
$url = 'http://' . $url;
}
if (preg_match('/^((http|https):\\/\\/)?(www.)?youtube.com/i', $url)) {
//youtube video
if (preg_match('/youtube.com\\/watch\\?v=/i', $url)) {
$url = str_replace('youtube.com/watch?v=', 'youtube.com/embed/', $url);
}
if (ipIsManagementState()) {
if (preg_match('/\\?/s', $url)) {
$url .= '&wmode=opaque';
} else {
$url .= '?wmode=opaque';
}
}
return $this->renderView('view/youtube.php', $url, $data);
}
if (preg_match('/^((http|https):\\/\\/)?(www.)?youtu.be/i', $url)) {
//youtube video
$url = str_replace('youtu.be/', 'youtube.com/embed/', $url);
if (ipIsManagementState()) {
if (preg_match('/\\?/s', $url)) {
$url .= '&wmode=opaque';
} else {
$url .= '?wmode=opaque';
}
}
return $this->renderView('view/youtube.php', $url, $data);
}
if (preg_match('/^((http|https):\\/\\/)?(www.)?(player.)?vimeo.com/i', $url)) {
if (preg_match('%www.vimeo.com%i', $url)) {
$url = str_replace('www.vimeo.com', 'player.vimeo.com', $url);
}
if (preg_match('%//vimeo.com%i', $url)) {
$url = str_replace('//vimeo.com', '//player.vimeo.com', $url);
}
if (strpos($url, '/video') === false) {
$url = str_replace('vimeo.com', 'vimeo.com/video', $url);
}
return $this->renderView('view/vimeo.php', $url, $data);
}
return false;
}
示例4: ipBeforeController
public static function ipBeforeController()
{
if (ipIsManagementState()) {
ipAddCss('assets/gridWidget.css');
ipAddCss('assets/admin_custom.css');
}
ipAddCss('assets/style.css');
ipAddJs('assets/scripts.js');
}
示例5: index
public function index()
{
$revision = \Ip\ServiceLocator::content()->getCurrentRevision();
if ($revision) {
return \Ip\Internal\Content\Model::generateBlock('main', $revision['revisionId'], 0, ipIsManagementState());
} else {
return '';
}
}
示例6: ipBeforeController
public static function ipBeforeController()
{
if (ipIsManagementState()) {
// Works only if admin is logged in (AJAX is sent to Admin Controller)
if (isset($_SESSION['module']['system']['adminJustLoggedIn']) && ipAdminPermission('Super admin')) {
ipAddJs('Ip/Internal/System/assets/usageStatistics.js');
ipAddJsVariable('ipSystemSendUsageStatistics', 1);
}
}
}
示例7: getTwitterView
private static function getTwitterView($view)
{
$username = Model::getTwitterUsername();
$widget_id = Model::getTwitterWidgetID();
if ($username && $widget_id) {
$data['username'] = $username;
$data['widget_id'] = $widget_id;
return ipView('view/' . $view . '.php', $data)->render();
} else {
if (ipIsManagementState()) {
return ipView('view/error.php')->render();
}
return false;
}
}
示例8: generateBlockHtml
private function generateBlockHtml($revisionId)
{
$predefinedContent = \Ip\ServiceLocator::content()->getBlockContent($this->name);
if ($predefinedContent !== null) {
return $predefinedContent;
}
if (ipContent()->getCurrentPage() == null && $revisionId == 0 && !$this->isStatic) {
return '';
}
if ($this->isStatic) {
$languageId = ipContent()->getCurrentLanguage()->getId();
$revisionId = 0;
} else {
if ($revisionId === 0) {
$revision = \Ip\ServiceLocator::content()->getCurrentRevision();
if ($revision) {
$revisionId = $revision['revisionId'];
}
}
$languageId = 0;
}
return \Ip\Internal\Content\Model::generateBlock($this->name, $revisionId, $languageId, ipIsManagementState(), $this->exampleContent);
}
示例9: ipBeforeController_70
/**
* Used when management is needed in controller routed using routes.
* @param $info
* @return null
*/
public static function ipBeforeController_70($info)
{
if (empty($info['page']) || empty($info['management']) || !ipIsManagementState()) {
return null;
}
//find current page
$page = $info['page'];
// change layout if safe mode
if (\Ip\Internal\Admin\Service::isSafeMode()) {
ipSetLayout(ipFile('Ip/Internal/Admin/view/safeModeLayout.php'));
} else {
ipSetLayout($page->getLayout());
}
// initialize management
if (!ipRequest()->getQuery('ipDesignPreview') && !ipRequest()->getQuery('disableManagement')) {
Helper::initManagement();
}
//show page content
$response = ipResponse();
$response->setDescription(\Ip\ServiceLocator::content()->getDescription());
$response->setKeywords(ipContent()->getKeywords());
$response->setTitle(ipContent()->getTitle());
}
示例10: __
<?php
$buttonAction = 'ipsContentPublish';
$buttonText = __('Published', 'Ip-admin', false);
$buttonClass = 'btn-default';
$button2Class = 'btn-default';
$revisionClass = 'btn-default';
$button2Action = 'ipsContentSave';
$button2Text = __('Save', 'Ip-admin', false);
if (!$isPublished) {
$buttonText = __('Publish', 'Ip-admin', false);
$buttonClass = 'btn-warning';
$revisionClass = 'btn-warning';
}
if (!$isVisible && ipIsManagementState()) {
$buttonAction = 'ipsContentSave';
$button2Action = 'ipsContentPublish';
$button2Class = 'btn-warning';
$revisionClass = 'btn-warning';
$buttonClass = 'btn-default';
$buttonText = __('Save', 'Ip-admin', false);
$button2Text = __('Publish', 'Ip-admin', false);
}
?>
<div class="ipModuleContentPublishButton btn-group">
<button type="button" class="btn <?php
echo $buttonClass;
?>
navbar-btn <?php
echo $buttonAction;
?>
示例11: foreach
<?php
if (isset($images) && is_array($images)) {
?>
<div class="_container">
<?php
foreach ($images as $imageKey => $image) {
?>
<div class="_item ipsItem">
<a
<?php
if ($image['type'] == 'lightbox' && !ipIsManagementState()) {
?>
rel="lightbox"
href="<?php
echo escAttr($image['imageBig']);
?>
"
<?php
}
?>
<?php
if ($image['type'] == 'link') {
?>
href="<?php
echo escAttr($image['url']);
?>
"
<?php
echo $image['blank'] ? ' target="_blank" ' : '';
?>
示例12: 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);
}
$revision = $this->getCurrentRevision();
$page = ipContent()->getCurrentPage();
$javascriptFilesSorted = ipFilter('ipJs', $javascriptFilesSorted);
$language = ipContent()->getCurrentLanguage();
$data = array('ip' => array('baseUrl' => ipConfig()->baseUrl(), 'safeMode' => \Ip\Internal\Admin\Service::isSafeMode(), 'languageId' => $language->getId(), 'languageUrl' => $language->getLink(), 'languageCode' => $language->getCode(), 'languageTextDirection' => $language->getTextDirection(), 'theme' => ipConfig()->theme(), 'pageId' => $page ? $page->getId() : null, 'revisionId' => $revision['revisionId'], 'securityToken' => \Ip\ServiceLocator::application()->getSecurityToken(), 'developmentEnvironment' => ipConfig()->isDevelopmentEnvironment(), 'debugMode' => ipconfig()->isDebugMode(), 'isManagementState' => ipIsManagementState(), 'isAdminState' => ipAdminId() ? 1 : 0, 'isAdminNavbarDisabled' => ipRequest()->getQuery('disableAdminNavbar') ? 1 : 0), 'javascriptVariables' => $this->getJavascriptVariables(), 'javascript' => $javascriptFilesSorted);
$javascript = ipView('Ip/Internal/Config/view/javascript.php', $data)->render();
$javascript = ipFilter('ipJavaScript', $javascript);
return $javascript;
}
示例13: foreach
?>
<article <?php
if (ipIsManagementState()) {
echo 'title="' . $tile['label'] . '"';
}
?>
class="col-md-4 isotopeItem <?php
echo $widgetId . 'all';
foreach ($tile['filters'] as $f) {
echo ' ' . $widgetId . $f['filter'];
}
?>
">
<div>
<?php
echo \Ip\Internal\Content\Model::generateBlock('portfolio' . $originalWidgetId . '-' . $tile['blockId'], $revisionId, 0, ipIsManagementState());
?>
</div>
</article>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php
$portfolioJsScript = '
示例14: generateHtml
/**
* Renders widget's HTML output
*
* You can extend this method when generating widget's HTML.
*
* @param int $revisionId Widget revision ID
* @param int $widgetId Widget ID
* @param int $widgetId Widget instance ID
* @param array $data Widget data array
* @param string $skin Skin name
* @return string Widget's HTML code
*/
public function generateHtml($revisionId, $widgetId, $data, $skin)
{
try {
if ($this->core) {
$skinFile = 'Ip/Internal/' . $this->pluginName . '/' . Model::WIDGET_DIR . '/' . $this->name . '/' . self::SKIN_DIR . '/' . $skin . '.php';
} else {
$skinFile = 'Plugin/' . $this->pluginName . '/' . Model::WIDGET_DIR . '/' . $this->name . '/' . self::SKIN_DIR . '/' . $skin . '.php';
}
if (!is_file(ipFile($skinFile)) && !is_file(ipThemeFile(\Ip\View::OVERRIDE_DIR . '/' . $skinFile))) {
$skin = 'default';
if ($this->core) {
$skinFile = 'Ip/Internal/' . $this->pluginName . '/' . Model::WIDGET_DIR . '/' . $this->name . '/' . self::SKIN_DIR . '/' . $skin . '.php';
} else {
$skinFile = 'Plugin/' . $this->pluginName . '/' . Model::WIDGET_DIR . '/' . $this->name . '/' . self::SKIN_DIR . '/' . $skin . '.php';
}
}
$answer = ipView($skinFile, $data)->render();
} catch (\Ip\Exception $e) {
if (ipIsManagementState()) {
$answer = $e->getMessage() . "\n " . $e->getTraceAsString();
} else {
$answer = '';
}
}
return $answer;
}
示例15: isset
<?php
if (ipIsManagementState()) {
?>
<div class="ipsContainer"></div>
<?php
} else {
?>
<?php
echo isset($html) ? $html : '';
}