当前位置: 首页>>代码示例>>PHP>>正文


PHP Permissions::canAddSubContent方法代码示例

本文整理汇总了PHP中Permissions::canAddSubContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canAddSubContent方法的具体用法?PHP Permissions::canAddSubContent怎么用?PHP Permissions::canAddSubContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Permissions的用法示例。


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

示例1: checkSSL

 public function checkSSL()
 {
     if ($this->requireSSL == 1) {
         global $c;
         $cp = new Permissions($c);
         if (isset($cp)) {
             if (!$cp->canWrite() && !$cp->canAddSubContent() && !$cp->canAdminPage() && !$cp->canApproveCollection()) {
                 if ($_SERVER['HTTPS'] != "on") {
                     $redirect = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
                     header("Location:{$redirect}");
                 }
             }
         }
     }
 }
开发者ID:sixeightmedia,项目名称:formify,代码行数:15,代码来源:controller.php

示例2: array

	$dc = Page::getByID($_REQUEST['destCID']);
}

$valt = Loader::helper('validation/token');

$json = array();
$json['error'] = false;
$json['message'] = false;

if (is_object($oc) && is_object($dc)) {
	$ocp = new Permissions($oc);
	$dcp = new Permissions($dc);
	$ct = CollectionType::getByID($dc->getCollectionTypeID());
	if (!$ocp->canRead()) {
		$error = t("You cannot view the source page.");
	} else if (!$dcp->canAddSubContent($ct)) {
		$error = t("You do not have sufficient privileges to add this type of page to this destination.");
	} else if (!$oc->canMoveCopyTo($dc)) {
		$error = t("You may not move/copy/alias the chosen page to that location.");
	} else {
		$error = false;
	}
}

if (!$error) {
	if ($_REQUEST['ctask']) {
		if ($valt->validate()) {
			switch($_REQUEST['ctask']) {
				case "ALIAS":
					$ncID = $oc->addCollectionAlias($dc);
					$successMessage = '"' . $oc->getCollectionName() . '" '.t('was successfully aliased beneath').' "' . $dc->getCollectionName() . '"';
开发者ID:notzen,项目名称:concrete5,代码行数:31,代码来源:sitemap_drag_request.php

示例3: t

                        $statusMessage .= " " . t('Only administrators can approve a multi-page delete operation.');
                    }
                } else {
                    if ($children == 0 && $cp->canApproveCollection() && (!$c->isCheckedOut() || $c->isCheckedOut() && $c->isEditMode())) {
                        $statusMessage .= " <a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionID() . "&ctask=approve_pending_action" . $token . "'>" . t('Approve Delete') . "</a> | <a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionID() . "&ctask=clear_pending_action" . $token . "'>" . t('Cancel') . "</a>";
                    }
                }
            }
        }
    }
    if ($c->isMasterCollection()) {
        $statusMessage .= $statusMessage ? "<br/>" : "";
        $statusMessage .= t('Page Defaults for') . ' "' . $c->getCollectionTypeName() . '" ' . t("page type");
        $statusMessage .= "<br/>" . t('(All edits take effect immediately)');
    }
    if ($dh->canRead() || $cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage() || $cp->canApproveCollection()) {
        $cID = $c->getCollectionID();
        ?>





menuHTML += '<div id="ccm-page-controls-wrapper" class="ccm-ui">';
menuHTML += '<div id="ccm-toolbar">';

menuHTML += '<ul id="ccm-main-nav">';
menuHTML += '<li id="ccm-logo-wrapper"><?php 
        echo Loader::helper('concrete/interface')->getToolbarLogoSRC();
        ?>
</li>';
开发者ID:rmxdave,项目名称:concrete5,代码行数:31,代码来源:page_controls_menu_js.php

示例4: Permissions

        $additionalArgs['isComposer'] = true;
        break;
    case 'mcd':
        $toolSection = "collection_mcd";
        $canViewPane = $cp->canWrite();
        $divID = "ccm-collection-mcd";
        break;
    case 'set_theme':
        $toolSection = "collection_theme";
        $divID = 'ccm-edit-collection-design';
        $canViewPane = $cp->canWrite();
        break;
    case 'add':
        $toolSection = "collection_add";
        $divID = 'ccm-edit-collection-design';
        $canViewPane = $cp->canAddSubContent();
        break;
    case 'add_external':
        $toolSection = "collection_add_external";
        $divID = 'ccm-edit-collection-external';
        $canViewPane = $cp->canWrite();
        break;
    case 'edit_external':
        $toolSection = "collection_edit_external";
        $divID = 'ccm-edit-collection-external';
        $cparent = Page::getByID($c->getCollectionParentID(), "RECENT");
        $cparentP = new Permissions($cparent);
        $canViewPane = $cparentP->canWrite();
        break;
}
if ($toolSection == "collection_permissions" && !$cp->canAdminPage()) {
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:31,代码来源:edit_collection_popup.php

示例5: render


//.........这里部分代码省略.........
				if ($view instanceof Page) {
					$_pageBlocks = $view->getBlocks();
					$_pageBlocksGlobal = $view->getGlobalBlocks();
					$_pageBlocks = array_merge($_pageBlocks, $_pageBlocksGlobal);
					if ($view->supportsPageCache($_pageBlocks, $this->controller)) {
						$pageContent = $view->getFromPageCache();
						if ($pageContent != false) {
							Events::fire('on_before_render', $this);
							if (defined('APP_CHARSET')) {
								header("Content-Type: text/html; charset=" . APP_CHARSET);
							}
							print($pageContent);
							Events::fire('on_render_complete', $this);
							if (ob_get_level() == OB_INITIAL_LEVEL) {
		
								require(DIR_BASE_CORE . '/startup/shutdown.php');
								exit;
							}
							return;
						}
					}
					
					foreach($_pageBlocks as $b1) {
						$btc = $b1->getInstance();
						// now we inject any custom template CSS and JavaScript into the header
						if('Controller' != get_class($btc)){
							$btc->outputAutoHeaderItems();
						}
						$btc->runTask('on_page_view', array($view));
					}
					
					// do we have any custom menu plugins?
					$cp = new Permissions($view);
					if ($cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage() || $cp->canApproveCollection()) { 
						$ih = Loader::helper('concrete/interface/menu');
						$_interfaceItems = $ih->getPageHeaderMenuItems();
						foreach($_interfaceItems as $_im) {
							$_controller = $_im->getController();
							$_controller->outputAutoHeaderItems();
						}
						unset($_interfaceItems);
						unset($_im);
						unset($_controller);
					}
					unset($_interfaceItems);
					unset($_im);
					unset($_controller);
					
					
					// now, we output all the custom style records for the design tab in blocks/areas on the page
					$c = $this->getCollectionObject();
					$view->outputCustomStyleHeaderItems(); 				
				}
	
				// finally, we include the theme (which was set by setTheme and will automatically include innerContent)
				// disconnect from our db and exit

				$this->controller->on_before_render();
				extract($this->controller->getSets());
				extract($this->controller->getHelperObjects());

				if ($content != false) {
					include($content);
				}

				$innerContent = ob_get_contents();
开发者ID:nbourguig,项目名称:concrete5,代码行数:67,代码来源:view.php

示例6: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
?>

</div>

<?php 
Loader::element('footer_required');
?>
<!-- Show hide the concrete5 toolbar -->
<?php 
$cp = new Permissions($c);
if ($cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage()) {
    ?>
<script>
var isBarVisible = false;
$(document).ready(function() {
    $("#ccm-page-controls-wrapper").stop(true, true).hide();
   $("body").append("<div style='padding:5px;text-align:center;background-color:#335B8A; position:fixed;top:82px;right:50px;color:white; border-bottom-left-radius: 4px; border-top-left-radius: 4px; border-bottom-right-radius: 4px; border-top-right-radius: 4px; z-index: 900; '><a style='padding:0;margin:0;line-height:100%;' href='javascript:;' id='c5showhidebarr'><span class='fa fa-pencil' style='color:white;' id='c5showhidebarrtxt'>Show edit bar</span></a>");
 
   $("#c5showhidebarr").click(function() {
      if(isBarVisible){
         $("#ccm-page-controls-wrapper").stop(true, true).hide(200);
         $("#c5showhidebarrtxt").text("Show edit bar");
      }
      else{
         $("#ccm-page-controls-wrapper").stop(true, true).show(200);
         $("#c5showhidebarrtxt").text("Hide edit bar");
      }
      isBarVisible = !isBarVisible;
开发者ID:sharadkap,项目名称:webfascia,代码行数:31,代码来源:footer_bottom.php

示例7: t

                        $statusMessage .= " " . t('Only administrators can approve a multi-page delete operation.');
                    }
                } else {
                    if ($children == 0 && $cp->canApproveCollection() && (!$c->isCheckedOut() || $c->isCheckedOut() && $c->isEditMode())) {
                        $statusMessage .= " <a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionID() . "&ctask=approve_pending_action" . $token . "'>" . t('Approve Delete') . "</a> | <a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionID() . "&ctask=clear_pending_action" . $token . "'>" . t('Cancel') . "</a>";
                    }
                }
            }
        }
    }
    if ($c->isMasterCollection()) {
        $statusMessage .= $statusMessage ? "<br/>" : "";
        $statusMessage .= t('Page Defaults for') . ' "' . $c->getCollectionTypeName() . '" ' . t("page type");
        $statusMessage .= "<br/>" . t('(All edits take effect immediately)');
    }
    if ($cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage() || $cp->canApproveCollection()) {
        ?>

menuHTML += '<div id="ccm-page-controls">';
menuHTML += '<div id="ccm-logo-wrapper"><img src="<?php 
        echo ASSETS_URL_IMAGES;
        ?>
/logo_menu.png" width="49" height="49" id="ccm-logo" /></div>';
menuHTML += '<div id="ccm-system-nav-wrapper1">';
menuHTML += '<div id="ccm-system-nav-wrapper2">';
menuHTML += '<ul id="ccm-system-nav">';

<?php 
        if ($sh->canRead() && $u->config('UI_SITEMAP')) {
            ?>
	menuHTML += '<li><a id="ccm-nav-sitemap" dialog-title="<?php 
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:31,代码来源:page_controls_menu_js.php


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