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


PHP Permissions::canApproveCollection方法代码示例

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


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

							$successMessage = '"' . $oc->getCollectionName() . '" '.t('and all its children were successfully copied beneath').' "' . $dc->getCollectionName() . '"';
						}
					} else {
						$nc2 = $oc->duplicate($dc);
						if (is_object($nc2)) {
							$successMessage = '"' . $oc->getCollectionName() . '" '.t('was successfully copied beneath').' "' . $dc->getCollectionName() . '"';
						}
					}
					if (!is_object($nc2)) {
						$error = t("An error occurred while attempting the copy operation.");
					} else {
						$newCID = $nc2->getCollectionID();
					}
					break;
				case "MOVE":
					if ($dcp->canApproveCollection() && $ocp->canApproveCollection()) {
						$_SESSION['movePageSaveOldPagePath'] = $_REQUEST['saveOldPagePath'];
						if ($_REQUEST['saveOldPagePath']) {
							$nc2 = $oc->move($dc, true);
						} else {
							$nc2 = $oc->move($dc);
						}
						$successMessage = '"' . $oc->getCollectionName() . '" '.t('was moved beneath').' "' . $dc->getCollectionName() . '"';
					} else {
						$oc->markPendingAction('MOVE', $dc);
						$successMessage = t("Your request to move \"%s\" beneath \"%s\" has been stored. Someone with approval rights will have to activate the change.", $oc->getCollectionName() , $dc->getCollectionName() );
					}
					$newCID = $oc->getCollectionID();
					break;
			}
		} else {
开发者ID:notzen,项目名称:concrete5,代码行数:31,代码来源:sitemap_drag_request.php

示例3: User

$token = '&' . $valt->getParameter();
if (isset($cp)) {
    $u = new User();
    $username = $u->getUserName();
    $vo = $c->getVersionObject();
    $statusMessage = '';
    if ($c->isCheckedOut()) {
        if (!$c->isCheckedOutByMe()) {
            $cantCheckOut = true;
            $statusMessage .= t("%s is currently editing this page.", $c->getCollectionCheckedOutUserName());
        }
    }
    if ($c->getCollectionPointerID() > 0) {
        $statusMessage .= t("This page is an alias of one that actually appears elsewhere. ");
        $statusMessage .= "<br/><a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionID() . "'>" . t('View/Edit Original') . "</a>";
        if ($cp->canApproveCollection()) {
            $statusMessage .= "&nbsp;|&nbsp;";
            $statusMessage .= "<a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionPointerOriginalID() . "&ctask=remove-alias" . $token . "'>" . t('Remove Alias') . "</a>";
        }
    } else {
        if (is_object($vo)) {
            if (!$vo->isApproved() && !$c->isEditMode()) {
                $statusMessage .= t("This page is pending approval.");
                if ($cp->canApproveCollection() && !$c->isCheckedOut()) {
                    $statusMessage .= "<br/><a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionID() . "&ctask=approve-recent" . $token . "'>" . t('Approve Version') . "</a>";
                }
            }
        }
        $pendingAction = $c->getPendingAction();
        if ($pendingAction == 'MOVE') {
            $statusMessage .= $statusMessage ? "&nbsp;|&nbsp;" : "";
开发者ID:rmxdave,项目名称:concrete5,代码行数:31,代码来源:page_controls_menu_js.php

示例4: 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

示例5: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$valt = Loader::helper('validation/token');
$fh = Loader::helper('file');
$token = '&' . $valt->getParameter();
$c = Page::getByID($_REQUEST['cID']);
$cID = $c->getCollectionID();
$cp = new Permissions($c);
$isCheckedOut = $c->isCheckedOut() && !$c->isEditMode();
if (!$cp->canReadVersions() && !$cp->canApproveCollection()) {
    die(_("Access Denied."));
}
if ($_GET['vtask'] == 'view_version') {
    ?>
		<?php 
    /*
    		we use the always-updated ID below so that Safari doesn't cache the iframe's contents. We probably shouldn't be
    		making a new iframe on every request to this anyway, but it doesn't happen very often and it represents a significant
    		hurdle to making it a bit of a better citizen, so we'll do it this way for now.
    */
    ?>
		
		<iframe border="0" id="v<?php 
    echo time();
    ?>
" frameborder="0" height="100%" width="100%" src="<?php 
    echo BASE_URL . DIR_REL;
    ?>
/<?php 
    echo DISPATCHER_FILENAME;
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:31,代码来源:versions.php

示例6: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$c = Page::getByID($_REQUEST['cID']);
$cp = new Permissions($c);
if (!$cp->canWrite()) {
    die(_("Access Denied."));
}
$v = CollectionVersion::get($c, "RECENT", true);
if ($cp->canApproveCollection()) {
    $approveChecked = "";
    if (isset($_SESSION['checkInApprove'])) {
        if ($_SESSION['checkInApprove'] == true) {
            $approveChecked = " checked";
        }
    }
}
Loader::element('pane_header', array('c' => $c));
?>
<div class="ccm-pane-controls">
    <div id="ccm-edit-collection">
        <form method="post" id="ccm-check-in" action="<?php 
echo DIR_REL;
?>
/<?php 
echo DISPATCHER_FILENAME;
?>
?cID=<?php 
echo $c->getCollectionID();
?>
&ctask=check-in">
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:31,代码来源:check_in.php

示例7: approve

 function approve($doReindexImmediately = true)
 {
     $db = Loader::db();
     $u = new User();
     $uID = $u->getUserID();
     $cvID = $this->cvID;
     $cID = $this->cID;
     $c = Page::getByID($cID, $this->cvID);
     $ov = Page::getByID($cID, 'ACTIVE');
     $oldHandle = $ov->getCollectionHandle();
     $newHandle = $this->cvHandle;
     // update a collection updated record
     $dh = Loader::helper('date');
     $db->query('update Collections set cDateModified = ? where cID = ?', array($dh->getLocalDateTime(), $cID));
     // first we remove approval for the other version of this collection
     $v = array($cID);
     $q = "update CollectionVersions set cvIsApproved = 0 where cID = ?";
     $r = $db->query($q, $v);
     $ov->refreshCache();
     // now we approve our version
     $v2 = array($uID, $cID, $cvID);
     $q2 = "update CollectionVersions set cvIsNew = 0, cvIsApproved = 1, cvApproverUID = ? where cID = ? and cvID = ?";
     $r = $db->query($q2, $v2);
     // next, we rescan our collection paths for the particular collection, but only if this isn't a generated collection
     // I don't know why but this just isn't reliable. It might be a race condition with the cached page objects?
     /*
     if ((($oldHandle != $newHandle) || $oldHandle == '') && (!$c->isGeneratedCollection())) {
     */
     $c->rescanCollectionPath();
     //}
     // check for related version edits. This only gets applied when we edit global areas.
     if ($this->isNew()) {
         $r = $db->Execute('select cRelationID, cvRelationID from CollectionVersionRelatedEdits where cID = ? and cvID = ?', array($cID, $cvID));
         while ($row = $r->FetchRow()) {
             $cn = Page::getByID($row['cRelationID'], $row['cvRelationID']);
             $cnp = new Permissions($cn);
             if ($cnp->canApproveCollection()) {
                 $v = $cn->getVersionObject();
                 if ($v->isNew()) {
                     $v->approve();
                 }
             }
         }
     }
     Events::fire('on_page_version_approve', $c);
     $c->reindex(false, $doReindexImmediately);
     $this->refreshCache();
 }
开发者ID:rmxdave,项目名称:concrete5,代码行数:48,代码来源:collection_version.php

示例8: die

<?

defined('C5_EXECUTE') or die("Access Denied.");
$c = Page::getByID($_REQUEST['cID']);
$cp = new Permissions($c);
if (!$cp->canWrite()) {
	die(t("Access Denied."));
}

$v = CollectionVersion::get($c, "RECENT", true);

if ($cp->canApproveCollection()) {
	$approveChecked = "";
	if (isset($_SESSION['checkInApprove'])) {
		if ($_SESSION['checkInApprove'] == true) {
			$approveChecked = " checked";
		}
	}
}

Loader::element('pane_header', array('c'=>$c)); 
?>
<div class="ccm-pane-controls">
    <div id="ccm-edit-collection">
        <form method="post" id="ccm-check-in" action="<?php 
echo DIR_REL;
?>
/<?php 
echo DISPATCHER_FILENAME;
?>
?cID=<?php 
开发者ID:nbourguig,项目名称:concrete5,代码行数:31,代码来源:check_in.php

示例9: User

	$u = new User();
	$username = $u->getUserName();
	$vo = $c->getVersionObject();

	$statusMessage = '';
	if ($c->isCheckedOut()) {
		if (!$c->isCheckedOutByMe()) {
			$cantCheckOut = true;
			$statusMessage .= t("%s is currently editing this page.", $c->getCollectionCheckedOutUserName());
		}
	}
	
	if ($c->getCollectionPointerID() > 0) {
		$statusMessage .= t("This page is an alias of one that actually appears elsewhere. ");
		$statusMessage .= "<br/><a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionID() . "'>" . t('View/Edit Original') . "</a>";
		if ($cp->canApproveCollection()) {
			$statusMessage .= "&nbsp;|&nbsp;";
			$statusMessage .= "<a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionPointerOriginalID() . "&ctask=remove-alias" . $token . "'>" . t('Remove Alias') . "</a>";
		}
	} else {
	
		if (is_object($vo)) {
			if (!$vo->isApproved() && !$c->isEditMode()) {
				$statusMessage .= t("This page is pending approval.");
				if ($cp->canApproveCollection() && !$c->isCheckedOut()) {
					$statusMessage .= "<br/><a href='" . DIR_REL . "/" . DISPATCHER_FILENAME . "?cID=" . $c->getCollectionID() . "&ctask=approve-recent" . $token . "'>" . t('Approve Version') . "</a>";
				}
			}
		}
		
		$pendingAction = $c->getPendingAction();
开发者ID:rowejd,项目名称:concrete5,代码行数:31,代码来源:page_controls_menu_js.php


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