Exemplo n.º 1
0
function xos_get_generated_page_path_ids($id)
{
    $calculated_page_path_string = '';
    $calculated_page_path = xos_generate_page_path($id);
    for ($i = 0, $n = sizeof($calculated_page_path); $i < $n; $i++) {
        for ($j = 0, $k = sizeof($calculated_page_path[$i]); $j < $k; $j++) {
            $calculated_page_path_string .= $calculated_page_path[$i][$j]['id'] . '_';
        }
        $calculated_page_path_string = substr($calculated_page_path_string, 0, -1) . '<br />';
    }
    $calculated_page_path_string = substr($calculated_page_path_string, 0, -6);
    if (strlen($calculated_page_path_string) < 1) {
        $calculated_page_path_string = TEXT_TOP;
    }
    return $calculated_page_path_string;
}
Exemplo n.º 2
0
     }
     $contents[] = array('text' => '<br /><a href="" onclick="pages.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a><a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&cpID=' . $cInfo->categories_or_pages_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 case 'move_page':
     $heading_title = '<b>' . TEXT_INFO_HEADING_MOVE_PAGE . '</b>';
     $form_tag = xos_draw_form('pages', FILENAME_PAGES, 'action=move_page_confirm&cPath=' . $cPath) . xos_draw_hidden_field('categories_or_pages_id', $cInfo->categories_or_pages_id);
     $contents[] = array('text' => sprintf(TEXT_MOVE_PAGES_INTRO, $cInfo->categories_or_pages_name));
     $contents[] = array('text' => '<br />' . sprintf(TEXT_MOVE, $cInfo->categories_or_pages_name) . '<br /><div class="form-group">' . xos_draw_pull_down_menu('move_to_page_id', xos_get_page_tree(), $cInfo->categories_or_pages_id, 'class="form-control"') . '</div>');
     $contents[] = array('text' => '<br /><a href="" onclick="pages.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_MOVE . ' ">' . BUTTON_TEXT_MOVE . '</a><a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&cpID=' . $cInfo->categories_or_pages_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
     break;
 default:
     if ($rows > 0) {
         if (isset($cInfo) && is_object($cInfo)) {
             // page info box contents
             $page_path_string = '';
             $page_path = xos_generate_page_path($cInfo->categories_or_pages_id);
             for ($i = sizeof($page_path[0]) - 1; $i > 0; $i--) {
                 $page_path_string .= $page_path[0][$i]['id'] . '_';
             }
             $page_path_string = substr($page_path_string, 0, -1);
             $heading_title = '<b>' . $cInfo->categories_or_pages_name . '</b>';
             $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $page_path_string . '&cpID=' . $cInfo->categories_or_pages_id . '&action=new_page') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $page_path_string . '&cpID=' . $cInfo->categories_or_pages_id . '&action=move_page') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_MOVE . ' ">' . BUTTON_TEXT_MOVE . '</a><a href="' . xos_href_link(FILENAME_PAGES, 'cPath=' . $page_path_string . '&cpID=' . $cInfo->categories_or_pages_id . '&action=delete_page') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a><a href="' . xos_href_link(FILENAME_PAGES, xos_get_path($cInfo->categories_or_pages_id) . '&action=new_page') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_NEW_PAGE . ' ' . $cInfo->categories_or_pages_name . ' ">' . BUTTON_TEXT_NEW_PAGE . ' "' . $cInfo->categories_or_pages_name . '"</a>');
             $contents[] = array('text' => '<br />' . TEXT_DATE_ADDED . ' ' . xos_date_short($cInfo->date_added));
             if (xos_not_null($cInfo->last_modified)) {
                 $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . xos_date_short($cInfo->last_modified));
             }
             $contents[] = array('text' => '<br />' . TEXT_SUBPAGES . ' ' . $cInfo->children_count . '<br />&nbsp;');
         }
     } else {
         $heading_title = '<b>' . EMPTY_PAGE . '</b>';
         $contents[] = array('text' => TEXT_NO_CHILD_PAGES);
Exemplo n.º 3
0
 $rows = 0;
 $pages_query = xos_db_query("select c.categories_or_pages_id, cpd.categories_or_pages_name, c.parent_id, c.page_not_in_menu, c.sort_order, c.date_added, c.last_modified, c.categories_or_pages_status  from " . TABLE_CATEGORIES_OR_PAGES . " c, " . TABLE_CATEGORIES_OR_PAGES_DATA . " cpd where c.parent_id = '" . (int) $current_page_id . "' and c.categories_or_pages_id = cpd.categories_or_pages_id and c.is_page != 'false' and cpd.language_id = '" . (int) $_SESSION['used_lng_id'] . "' order by c.sort_order, cpd.categories_or_pages_name");
 $pages_array = array();
 while ($pages = xos_db_fetch_array($pages_query)) {
     $pages_count++;
     $rows++;
     $children_in_page = xos_children_in_page_count($pages['categories_or_pages_id']);
     if ((!isset($_GET['cpID']) && !isset($_GET['pID']) || isset($_GET['cpID']) && $_GET['cpID'] == $pages['categories_or_pages_id']) && !isset($cInfo) && substr($action, 0, 3) != 'new') {
         $page_children = array('children_count' => $children_in_page);
         $cInfo_array = array_merge((array) $pages, (array) $page_children);
         $cInfo = new objectInfo($cInfo_array);
     }
     $pages_array[] = array('selected' => isset($cInfo) && is_object($cInfo) && $pages['categories_or_pages_id'] == $cInfo->categories_or_pages_id ? true : false, 'children' => $children_in_page > 0 ? $children_in_page : false, 'status' => $pages['categories_or_pages_status'] == '1' ? true : false, 'page_not_in_menu' => $pages['page_not_in_menu'] == '1' ? true : false, 'name' => htmlspecialchars($pages['categories_or_pages_name']), 'sort_order' => $pages['sort_order'], 'icon_status_green' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green.gif', ICON_TITLE_STATUS_GREEN), 'icon_status_red' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red.gif', ICON_TITLE_STATUS_RED), 'icon_status_green_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_green_light.gif', ICON_TITLE_STATUS_GREEN_LIGHT), 'icon_status_red_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_status_red_light.gif', ICON_TITLE_STATUS_RED_LIGHT), 'icon_not_in_menu_green' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_not_in_menu_green.gif', ICON_TITLE_STATUS_GREEN), 'icon_not_in_menu_red' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_not_in_menu_red.gif', ICON_TITLE_STATUS_RED), 'icon_not_in_menu_green_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_not_in_menu_green_light.gif', ICON_TITLE_STATUS_GREEN_LIGHT), 'icon_not_in_menu_red_light' => xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icon_not_in_menu_red_light.gif', ICON_TITLE_STATUS_RED_LIGHT), 'link_filename_pages_flag_status_0' => xos_href_link(FILENAME_PAGES, 'action=setflag_status&flag_status=0&cpID=' . $pages['categories_or_pages_id'] . '&cPath=' . $cPath), 'link_filename_pages_flag_status_1' => xos_href_link(FILENAME_PAGES, 'action=setflag_status&flag_status=1&cpID=' . $pages['categories_or_pages_id'] . '&cPath=' . $cPath), 'link_filename_pages_flag_not_in_menu_0' => xos_href_link(FILENAME_PAGES, 'action=setflag_menu&flag_menu=0&cpID=' . $pages['categories_or_pages_id'] . '&cPath=' . $cPath), 'link_filename_pages_flag_not_in_menu_1' => xos_href_link(FILENAME_PAGES, 'action=setflag_menu&flag_menu=1&cpID=' . $pages['categories_or_pages_id'] . '&cPath=' . $cPath), 'link_filename_pages_get_path' => xos_href_link(FILENAME_PAGES, xos_get_path($pages['categories_or_pages_id'])), 'link_filename_pages_edit' => xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&cpID=' . $pages['categories_or_pages_id'] . '&action=new_page'), 'link_filename_pages_cpath_cpath_cid' => xos_href_link(FILENAME_PAGES, 'cPath=' . $cPath . '&cpID=' . $pages['categories_or_pages_id']));
 }
 $cPath_back = '';
 $page_path = xos_generate_page_path($current_page_id);
 for ($i = sizeof($page_path[0]) - 1; $i > 0; $i--) {
     $current_page_id != $page_path[0][$i]['id'] ? $cPath_back .= $page_path[0][$i]['id'] . '_' : '';
 }
 $cPath_back = substr($cPath_back, 0, -1);
 $cPath_back = xos_not_null($cPath_back) ? 'cPath=' . $cPath_back . '&' : '';
 if ($current_page_id > 0) {
     $smarty->assign('link_filename_pages_back', xos_href_link(FILENAME_PAGES, $cPath_back . 'cpID=' . $current_page_id));
 }
 $page_tree = xos_get_page_tree();
 $current_page_name = '';
 for ($i = 0, $n = sizeof($page_tree); $i < $n; $i++) {
     if ($current_page_id == $page_tree[$i]['id']) {
         $current_page_name = ltrim($page_tree[$i]['text'], '&nbsp;');
     }
 }