コード例 #1
0
ファイル: aHelper.php プロジェクト: verenate/gri
function _a_navcolumn_body($page)
{
    $sortHandle = "";
    $sf_user = sfContext::getInstance()->getUser();
    $admin = $page->userHasPrivilege('edit');
    if ($admin) {
        $sortHandle = "<div class='a-btn icon a-drag a-controls'></div>";
    }
    $result = "";
    // Inclusion of archived pages should be a bit generous to allow for tricky situations
    // in which those who can edit a subpage might not be able to find it otherwise.
    // We don't want the performance hit of checking for the right to edit each archived
    // subpage, so just allow those with potential-editor privs to see that archived pages
    // exist, whether or not they are allowed to actually edit them
    if (aTools::isPotentialEditor() && $sf_user->getAttribute('show-archived', true, 'apostrophe')) {
        $livingOnly = false;
    } else {
        $livingOnly = true;
    }
    $result = '<ul id="a-navcolumn" class="a-navcolumn">';
    $childrenInfo = $page->getChildrenInfo($livingOnly);
    if (!count($childrenInfo)) {
        $childrenInfo = $page->getPeerInfo($livingOnly);
    }
    $n = 1;
    foreach ($childrenInfo as $childInfo) {
        $class = "peer_item";
        if ($childInfo['id'] == $page->id) {
            $class = "self_item";
        }
        if ($n == 1) {
            $class .= ' first';
        }
        if ($n == count($childrenInfo)) {
            $class .= ' last';
        }
        // Specific format to please jQuery.sortable
        $result .= "<li id=\"a-navcolumn-item-" . $childInfo['id'] . "\" class=\"a-navcolumn-item {$class}\">\n";
        $title = $childInfo['title'];
        if ($childInfo['archived']) {
            $title = '<span class="a-archived-page" title="&quot;' . $title . '&quot; is Unpublished">' . $title . '</span>';
        }
        $result .= $sortHandle . link_to($title, aTools::urlForPage($childInfo['slug']));
        $result .= "</li>\n";
        $n++;
    }
    $result .= "</ul>\n";
    if ($admin) {
        $result .= jq_sortable_element('#a-navcolumn', array('url' => 'a/sort?page=' . $page->getId()));
    }
    return $result;
}
コード例 #2
0
ファイル: _selectMultiple.php プロジェクト: verenate/gri
  <?php 
}
?>
  <?php 
echo __('When you\'re done, click "Save."', null, 'apostrophe');
?>
</p>

	<ul id="a-media-selection-list">
	<?php 
include_component("aMedia", "multipleList");
?>
	</ul>

	<?php 
echo jq_sortable_element("#a-media-selection-list", array("url" => "aMedia/multipleOrder"));
?>

	<br class="c"/>

	<ul class="a-controls a-media-slideshow-controls">
		<li><?php 
echo link_to(__("Save", null, 'apostrophe'), "aMedia/selected", array("class" => "a-btn save"));
?>
</li>
 	  <li><?php 
echo link_to(__("cancel", null, 'apostrophe'), "aMedia/selectCancel", array("class" => "a-btn icon a-cancel event-default"));
?>
</li>
	</ul>