Пример #1
0
        	src="' . $_style["icons_move_document"] .'" /></a>&nbsp;<a href="index.php?a=61&amp;id='.$children['id'].'" title="'.$_lang["publish_resource"].'"><img src="' . $_style["icons_publish_document"] .'" /></a>&nbsp;<a 
        	href="index.php?a=62&amp;id='.$children['id'].'" title="'.$_lang["unpublish_resource"].'"><img src="' . $_style["icons_unpublish_resource"] .'" /></a>' : '') .
        	(($modx->hasPermission('delete_document')) ? '&nbsp;<a href="index.php?a=6&amp;id='.$children['id'].'" title="'.$_lang['delete_resource'].'"><img src="' . $_style["icons_delete_document"] .'" /></a>&nbsp;<a href="index.php?a=63&amp;id='.$children['id'].'" title="'.$_lang['undelete_resource'].'"><img 
        	src="' . $_style["icons_undelete_resource"] .'" /></a>' : ''),
        );
        */
        // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь
        // для сохранения сортировки
        $icon_pub_unpub = !$children['published'] ? '<a href="index.php?a=61&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><img src="' . $_style["icons_publish_document"] . '" /></a>' : '<a 
				href="index.php?a=62&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><img src="' . $_style["icons_unpublish_resource"] . '" /></a>';
        $icon_del_undel = !$children['deleted'] ? '<a href="index.php?a=6&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><img src="' . $_style["icons_delete_document"] . '" /></a>' : '<a href="index.php?a=63&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><img src="' . $_style["icons_undelete_resource"] . '" /></a>';
        $listDocs[] = array('docid' => $children['id'], 'title' => $children['deleted'] ? '<span class="deleted">' . $children['pagetitle'] . '</span>' : ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '">' . ($children['published'] ? $children['pagetitle'] : '<span class=unpublish>' . $children['pagetitle'] . '</span>') . '</a>' : $children['pagetitle']), 'createdon' => $modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly'), 'pub_date' => $children['pub_date'] ? $modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly') : '', 'status' => $children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>', 'edit' => ($modx->hasPermission('edit_document') ? '&nbsp;<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><img src="' . $_style["icons_save"] . '" /></a>&nbsp;<a href="index.php?a=51&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><img 
				src="' . $_style["icons_move_document"] . '" /></a>&nbsp;' . $icon_pub_unpub . '&nbsp;' : '') . ($modx->hasPermission('delete_document') ? '&nbsp;' . $icon_del_undel : ''));
        /****************/
    }
    $childsTable->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort);
    $children_output = $childsTable->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
} else {
    // No Child documents
    $children_output = "<p>" . $_lang['resources_in_container_no'] . "</p>";
}
?>
<script type="text/javascript">
function duplicatedocument(){
	if(confirm("<?php 
echo $_lang['confirm_resource_duplicate'];
?>
")==true) {
		document.location.href="index.php?id=<?php 
echo $_REQUEST['id'];
?>
Пример #2
0
        $rowRegularClass = 'gridItem';
        $rowAlternateClass = 'gridAltItem';
        $childsTable->setTableClass($tableClass);
        $childsTable->setRowHeaderClass($rowHeaderClass);
        $childsTable->setRowRegularClass($rowRegularClass);
        $childsTable->setRowAlternateClass($rowAlternateClass);
        // Table header
        $listTableHeader = array('docid' => $_lang['id'], 'title' => $_lang['document_title'], 'status' => $_lang['page_data_status'], 'edit' => $_lang['mgrlog_action']);
        $tbWidth = array('5%', '60%', '10%', '25%');
        $childsTable->setColumnWidths($tbWidth);
        $limitClause = $childsTable->handlePaging();
        $listDocs = array();
        foreach ($resource as $k => $children) {
            $listDocs[] = array('docid' => $children['id'], 'title' => $children['pagetitle'], 'status' => $children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>', 'edit' => '<a href="index.php?a=3&amp;id=' . $children['id'] . '"><img src="' . $_style["icons_preview_document"] . '" />' . $_lang['view'] . '</a>' . ($modx->hasPermission('edit_document') ? '&nbsp;<a href="index.php?a=27&amp;id=' . $children['id'] . '"><img src="' . $_style["icons_save"] . '" />' . $_lang['edit'] . '</a>&nbsp;<a href="index.php?a=51&amp;id=' . $children['id'] . '"><img src="' . $_style["icons_move_document"] . '" />' . $_lang['move'] . '</a>' : ''));
        }
        $childsTable->createPagingNavigation($numRecords, 'a=3&amp;id=' . $content['id']);
        $children_output = $childsTable->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
    }
} else {
    // No Child documents
    $children_output = "<p>" . $_lang['documents_in_container_no'] . "</p>";
}
?>
<script type="text/javascript">
function duplicatedocument(){
	if(confirm("<?php 
echo $_lang['confirm_duplicate_document'];
?>
")==true) {
		document.location.href="index.php?id=<?php 
echo $_REQUEST['id'];