Guest User

Untitled

a guest
Oct 11th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 24.31 KB | None | 0 0
  1. <?php
  2. /*
  3.   $Id: extra_info_pages.php 4.50 2003/06/29 22:50:51 hpdl Exp $
  4.  
  5.   osCommerce, Open Source E-Commerce Solutions
  6.   http://www.oscommerce.com
  7.  
  8.   Copyright (c) 2003 osCommerce
  9.  
  10.   Released under the GNU General Public License
  11. */
  12.  
  13.   require('includes/application_top.php');
  14.  
  15.  
  16.  
  17.   $action = (isset($_GET['action']) ? $_GET['action'] : '');
  18.  
  19. $languages = tep_get_languages();
  20.  
  21. // Sets the status of a page
  22.   function tep_set_page_status($pages_id, $status) {
  23.     if ($status == '1') {
  24.       return tep_db_query("update " . TABLE_PAGES . " set status = '1'  where pages_id = '" . $pages_id . "'");
  25.     } elseif ($status == '0') {
  26.       return tep_db_query("update " . TABLE_PAGES . " set status = '0'  where pages_id = '" . $pages_id . "'");
  27.     } else {
  28.       return -1;
  29.     }
  30.   }
  31.  
  32.   if (tep_not_null($action)) {
  33.  
  34.  
  35.  
  36.  
  37.     switch ($action) {
  38.       case 'setflag':
  39.         if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
  40.           tep_set_page_status($_GET['bID'], $_GET['flag']);
  41.  
  42.           $messageStack->add_session(SUCCESS_PAGE_STATUS_UPDATED, 'success');
  43.         } else {
  44.           $messageStack->add_session(ERROR_UNKNOWN_STATUS_FLAG, 'error');
  45.         }
  46.  
  47.         tep_redirect(tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']));
  48.         break;
  49.       case 'insert':
  50.       case 'update':
  51.         if (isset($_POST['pages_id'])) $pages_id = tep_db_prepare_input($_POST['pages_id']);
  52.         $pages_title = tep_db_prepare_input($_POST['pages_title']);
  53.         $pages_html_text = tep_db_prepare_input($_POST['pages_html_text']);
  54.         $sort_order = tep_db_prepare_input($_POST['sort_order']);
  55.  
  56.         $intorext = tep_db_prepare_input($_POST['intorext']);
  57.  
  58. if($intorext == 1)  {
  59.        $externallink = tep_db_prepare_input($_POST['externallink']);
  60. }
  61. else  {
  62. $externallink="";
  63. }
  64.  
  65.  
  66.  
  67. $page_error = false;
  68.  
  69.  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
  70.  
  71. $title_field_name=$_POST['pages_title_'.$languages[$i]['id']];
  72.  
  73.         if (empty($title_field_name)) {
  74.           $messageStack->add(ERROR_PAGE_TITLE_REQUIRED, 'error');
  75.  
  76.  
  77.           $page_error = true;
  78.         }
  79.  }
  80.         if (empty($pages_html_text)) {
  81.  
  82.         }
  83.  
  84.  
  85.         if ($page_error == false) {
  86.  
  87.  
  88.  
  89.  
  90.  if ($action == 'insert') {
  91.  
  92.    if($page_type == "1" || $page_type == "2" || $page_type == "3" || $page_type == "4" || $page_type == "5" || $page_type == "6" || $page_type == "7" || $page_type == "8" || $page_type == "9")  {
  93.      $selectquery=tep_db_query("select count(*) as count from ". TABLE_PAGES ." where page_type=\"$page_type\"");
  94.      $exists = tep_db_fetch_array($selectquery);
  95.  
  96.         if($exists['count'] >= 1)  {
  97.            $updateall=tep_db_query("update ". TABLE_PAGES ." set page_type=\"9\" where page_type=\"$page_type\"");
  98.         }
  99.  
  100.    }
  101. }
  102.  
  103.  
  104.  if ($action == 'update') {
  105.  
  106.    if($page_type == "1" || $page_type == "2" || $page_type == "3" || $page_type == "4" || $page_type == "5" || $page_type == "6" || $page_type == "7" || $page_type == "8" || $page_type == "9")  {
  107.      $selectquery=tep_db_query("select count(*) as count from ". TABLE_PAGES ." where page_type=\"$page_type\" and pages_id != \"(int)$pages_id\"");
  108.      $exists = tep_db_fetch_array($selectquery);
  109.  
  110.         if($exists['count'] >= 1)  {
  111.            $updateall=tep_db_query("update ". TABLE_PAGES ." set page_type=\"9\" where page_type=\"$page_type\"");
  112.         }
  113.  
  114.    }
  115. }
  116.  
  117.  
  118.  
  119.  
  120. for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
  121.  
  122.  
  123. $pages_titlem=$_POST['pages_title_'.$languages[$i]['id']];
  124. $pages_html_textm=$_POST['pages_html_text_'.$languages[$i]['id']];
  125. $intorextm=$_POST['intorext_'.$languages[$i]['id']];
  126. $externallinkm=$_POST['externallink_'.$languages[$i]['id']];
  127. $link_targetm=$_POST['link_target_'.$languages[$i]['id']];
  128. $language_idm='language_id_'.$languages[$i]['id'];
  129.  
  130.  
  131.  
  132.           $sql_data_array_pages = array('sort_order' => $sort_order,
  133.                                         'status' => '1',
  134.                                         'page_type'   => $_POST['page_type']);
  135.  
  136.           $sql_data_array_pages_description = array('pages_title' => $pages_titlem,
  137.                                                     'pages_html_text' => stripslashes($pages_html_textm),
  138.                                                     'intorext'   => $intorextm,
  139.                                                     'externallink' => $externallinkm,
  140.                                                     'link_target' => $link_targetm);
  141.  
  142.  
  143.  
  144.          if ($action == 'insert') {
  145.  
  146. $bID="";
  147.  
  148.  
  149.          if ($i == 0)  {
  150.  
  151.             tep_db_perform(TABLE_PAGES, $sql_data_array_pages);
  152.  
  153.             $pages_id = tep_db_insert_id();
  154.  
  155.          }
  156.  
  157.             $pageid_merge= array('pages_id' => $pages_id,
  158.                                  'language_id' => $languages[$i]['id']);
  159.  
  160.             $sql_data_array_pages_desc = array_merge($sql_data_array_pages_description, $pageid_merge);
  161.  
  162.             tep_db_perform(TABLE_PAGES_DESCRIPTION, $sql_data_array_pages_desc);
  163.  
  164.             $messageStack->add_session(SUCCESS_PAGE_INSERTED, 'success');
  165.  
  166.  
  167.           } elseif ($action == 'update') {
  168.  
  169.  
  170.           if ($i == 0)  {
  171.             tep_db_perform(TABLE_PAGES, $sql_data_array_pages, 'update', "pages_id = '" . (int)$pages_id . "'");
  172.           }
  173.  
  174.  
  175.           $selectexists=tep_db_query("select count( * ) as `countrecords` from `".TABLE_PAGES_DESCRIPTION."` where pages_id='" . (int)$pages_id . "' and language_id='".$languages[$i]['id']."'");
  176.           $recordexists = tep_db_fetch_array($selectexists);
  177.  
  178.  
  179.  
  180.           if($recordexists['countrecords'] >= 1 )  {
  181.           tep_db_perform(TABLE_PAGES_DESCRIPTION, $sql_data_array_pages_description, 'update', "pages_id = '" . (int)$pages_id . "' and language_id='".$languages[$i]['id']."'");
  182.           }
  183.           else  {
  184.  
  185.                 $pageid_merge= array('pages_id' => $pages_id,
  186.                'language_id' => $languages[$i]['id']);
  187.  
  188.           $sql_data_array_pages_desc = array_merge($sql_data_array_pages_description, $pageid_merge);
  189.           tep_db_perform(TABLE_PAGES_DESCRIPTION, $sql_data_array_pages_desc);
  190.           }
  191.  
  192.  
  193.            $messageStack->add_session(SUCCESS_PAGE_UPDATED, 'success');
  194.  
  195.           }
  196.  
  197. } //for
  198.  
  199.  
  200.  
  201.  
  202.           tep_redirect(tep_href_link(FILENAME_PAGE_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'bID=' . $pages_id));
  203.         } else {
  204.           $action = 'new';
  205.         }
  206.  
  207.         break;
  208.  
  209.  
  210.       case 'deleteconfirm':
  211.         $pages_id = tep_db_prepare_input($_GET['bID']);
  212.  
  213.         tep_db_query("delete from " . TABLE_PAGES . " where pages_id = '" . (int)$pages_id . "'");
  214.         tep_db_query("delete from " . TABLE_PAGES_DESCRIPTION . " where pages_id = '" . (int)$pages_id . "'");
  215.  
  216.         $messageStack->add_session(SUCCESS_PAGE_REMOVED, 'success');
  217.  
  218.         tep_redirect(tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page']));
  219.         break;
  220.     }
  221.  
  222.   }
  223.  
  224.  
  225. require(DIR_WS_INCLUDES . 'template_top.php');
  226.  
  227.  
  228. ?>
  229.  
  230.  
  231. <div id="spiffycalendar" class="text"></div>
  232. <!-- header //-->
  233. <? // php require(DIR_WS_INCLUDES . 'header.php'); ?>
  234. <!-- header_eof //-->
  235.  
  236. <!-- body //-->
  237. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  238.   <tr>
  239.     <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
  240. <!-- left_navigation //-->
  241. <? // php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
  242. <!-- left_navigation_eof //-->
  243.     </table></td>
  244. <!-- body_text //-->
  245.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  246.       <tr>
  247.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  248.           <tr>
  249.             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
  250.             <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  251.           </tr>
  252.         </table></td>
  253.       </tr>
  254. <?php
  255.  
  256.  
  257.   if ($action == 'new') {
  258.     $form_action = 'insert';
  259.  
  260.     $parameters = array('pages_title' => '',
  261.                         'pages_html_text' => '',
  262.                         'sort_order' =>'',
  263.                         'status' =>'');
  264.  
  265.     $bInfo = new objectInfo($parameters);
  266.  
  267.     if (isset($_GET['bID'])) {
  268.       $form_action = 'update';
  269.  
  270.       $bID = tep_db_prepare_input($_GET['bID']);
  271.  
  272.  
  273.  
  274.       $page_query = tep_db_query("select
  275.                                    s.status,
  276.                                    s.sort_order,
  277.                                    s.page_type,
  278.                                    p.pages_title,
  279.                                    p.pages_html_text,
  280.                                    p.intorext,
  281.                                    p.externallink,
  282.                                    p.link_target,
  283.                                    p.language_id
  284.                                  from
  285.                                    " . TABLE_PAGES . " s left join " . TABLE_PAGES_DESCRIPTION . " p on s.pages_id=p.pages_id
  286.                                  where
  287.                                    s.pages_id = '" . (int)$bID . "'");
  288.  
  289.  
  290. #      $page = tep_db_fetch_array($page_query);
  291. #      $bInfo->objectInfo($page);
  292.  
  293. #while($bInfo->objectInfo($page))  {
  294. #
  295. #$pagetitle[$bInfo->language_id]= $bInfo->pages_title;
  296. #
  297. #echo $bInfo->pages_title;
  298. #
  299. #}
  300.  
  301.  
  302. while($page = tep_db_fetch_array($page_query))  {
  303.  
  304. $languageid=$page['language_id'];
  305. $page_type=$page['page_type'];
  306.  
  307. $pagetitle[$languageid]= $page['pages_title'];
  308. $sortorder=$page['sort_order'];
  309. $pages_html_text[$languageid]=$page['pages_html_text'];
  310. $intorext[$languageid]=$page['intorext'];
  311. $externallink[$languageid]=$page['externallink'];
  312. $link_target[$languageid]=$page['link_target'];
  313. }
  314.  
  315.  
  316.     } elseif (tep_not_null($_POST)) {
  317.       $bInfo->objectInfo($_POST);
  318.     }
  319.  
  320. $bIDif="";
  321. if(!empty($bID) && $bID != "")  {
  322. $bIDif='&bID='.$bID;
  323. }
  324.  
  325. ?>
  326.  
  327.  
  328.       <tr>
  329.         <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  330.       </tr>
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.       <tr><?php echo tep_draw_form('new_page', FILENAME_PAGE_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'action=' . $form_action.$bIDif, 'post', 'enctype="multipart/form-data"'); if ($form_action == 'update') echo tep_draw_hidden_field('pages_id', $bID); ?>
  340.         <td><table border="0" cellspacing="0" cellpadding="2">
  341.  
  342.  <tr>
  343.             <td class="main"><?php echo TEXT_PAGES_TYPE; ?></td>
  344.             <td class="main"><?echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'?><select name="page_type" size=1>
  345.                                  <option value="1" <? if($page_type == 1) { echo 'selected="selected"'; } ?>>1 - Index</option>
  346.                                  <option value="2" <? if($page_type == 2) { echo 'selected="selected"'; } ?>>2 - Contact Us</option>
  347.                                  <option value="3" <? if($page_type == 3) { echo 'selected="selected"'; } ?>>3 - Shipping</option>
  348.                                  <option value="4" <? if($page_type == 4) { echo 'selected="selected"'; } ?>>4 - Privacy</option>
  349.                                  <option value="5" <? if($page_type == 5) { echo 'selected="selected"'; } ?>>5 - Links</option>
  350.                                  <option value="6" <? if($page_type == 6) { echo 'selected="selected"'; } ?>>6 - Content</option>
  351.                                  <option value="7" <? if($page_type == 7) { echo 'selected="selected"'; } ?>>7 - Other</option>
  352.                                  <option value="8" <? if($page_type == 8) { echo 'selected="selected"'; } ?>>8 - Other</option>
  353.                                  <option value="9" <? if($page_type == 9) { echo 'selected="selected"'; } ?>>9 - Old Page</option>
  354.                                  </select></td>
  355.           </tr>
  356.  
  357.  
  358. <?
  359.  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
  360. ?>
  361.           <tr>
  362.             <td class="main"><?php if ($i == 0) echo TEXT_PAGES_TITLE; ?></td>
  363.             <td class="main">
  364.  
  365. <?php
  366. echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']). '&nbsp;'.tep_draw_input_field('pages_title_'.$languages[$i]['id'], $pagetitle[$languages[$i]['id']], '', true);
  367. }
  368.  
  369. ?>
  370.  
  371.  
  372. </td>
  373.           </tr>
  374.  
  375.           <tr>
  376.             <td class="main"><?php echo TEXT_PAGES_SORT_ORDER; ?></td>
  377.             <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' .  tep_draw_input_field('sort_order', $sortorder, '', false); ?></td>
  378.           </tr>
  379.  
  380.  
  381.  
  382.  
  383. </tr>
  384.  
  385.           <tr>
  386.             <td class="main">&nbsp;</td>
  387.             <td class="main">&nbsp;</td>
  388.           </tr>
  389.  
  390.  
  391.  
  392.  
  393. <?
  394.  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
  395. ?>
  396.  
  397.  
  398. <?php if(empty($intorext[$languages[$i]['id']]) or $intorext[$languages[$i]['id']] == "0")  {
  399. $internalchecked="checked";
  400. $externalchecked="";
  401. $disabledlinkbox="disabled";
  402. }
  403. else {
  404. $internalchecked="";
  405. $externalchecked="checked";
  406. $disabledlinkbox="";
  407. }
  408.  
  409. ?>
  410.  
  411.  
  412.  <tr>
  413.             <td class="main"><?php echo TEXT_PAGES_INTEXT; ?></td>
  414.             <td class="main">
  415.           <?  echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) ?><input type="radio" value="0" name="intorext_<?php echo $languages[$i]['id']; ?>" <?php echo $internalchecked; ?> onClick='disableIt("<? echo 'externallink_'.$languages[$i]['id']; ?>");'><? echo TEXT_TARGET_INTERNAL; ?>
  416.             &nbsp;&nbsp;
  417.             <? echo tep_draw_separator('pixel_trans.gif', '24', '15'); ?><input type="radio" value="1" name="intorext_<?php echo $languages[$i]['id']; ?>" <?php echo $externalchecked;?> onClick='enableIt("<? echo 'externallink_'.$languages[$i]['id']; ?>");'><? echo TEXT_TARGET_EXTERNAL; ?>
  418. </td>
  419.           </tr>
  420.  
  421.   <tr>
  422.             <td class="main"><?php echo TEXT_PAGES_EXTERNAL_LINK; ?></td>
  423.             <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']).'&nbsp;'.tep_draw_input_field('externallink_'.$languages[$i]['id'], $externallink[$languages[$i]['id']], 'id='.'"externallink_'.$languages[$i]['id'].'"'. $disabledlinkbox, false); ?></td>
  424.           </tr>
  425.  
  426.  
  427.  
  428. <?php if(empty($link_target[$languages[$i]['id']]) or $link_target[$languages[$i]['id']] == "0")  {
  429. $samewindowchecked="checked";
  430. $newwindowchecked="";
  431. }
  432. else {
  433. $samewindowchecked="";
  434. $newwindowchecked="checked";
  435. }
  436. ?>
  437.  
  438.   <tr>
  439.             <td class="main"><?php echo TEXT_TARGET; ?></td>
  440.  
  441.             <td class="main">
  442.  
  443. <?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']);?><input type="radio" value="0" name="link_target_<?php echo $languages[$i]['id']; ?>" <?php echo $samewindowchecked; ?>><? echo TEXT_TARGET_SAMEWINDOW; ?>
  444.  
  445. <input type="radio" value="1" name="link_target_<?php echo $languages[$i]['id']; ?>" <?php echo $newwindowchecked; ?>><? echo TEXT_TARGET_NEWWINDOW; ?>
  446.  
  447.  
  448. </td>
  449.           </tr>
  450.  
  451.  
  452.  
  453.  
  454. <tr>
  455.             <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  456.           </tr>
  457.  
  458.  
  459. <?
  460. }
  461. ?>
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479. <?
  480.  for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
  481. ?>
  482.  
  483.           <tr>
  484.            <td valign="top" class="main"><br>
  485. <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']). '&nbsp;'.tep_draw_textarea_field('pages_html_text_'.$languages[$i]['id'],'soft','50','10', $pages_html_text[$languages[$i]['id']]); ?>
  486. </td>
  487. </tr>
  488.  
  489. <?
  490. }
  491. ?>
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.           <tr>
  499.             <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  500.           </tr>
  501.         </table></td>
  502.       </tr>
  503.       <tr>
  504.         <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
  505.       </tr>
  506.       <tr>
  507.         <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  508.           <tr>
  509.             <td class="main" align="center"><?php echo TEXT_PAGES_PAGE_NOTE . '<br>'; ?></td>
  510.             <td class="main" align="right" valign="top" nowrap><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_PAGE_MANAGER, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . (!empty($bID) and $bID != "" ? 'bID=' . $bID : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>
  511.           </tr>
  512.         </table>
  513.  
  514. <input type="hidden" name="bID" value="<? echo $bID; ?>">
  515.  
  516. </td>
  517.       </form></tr>
  518. <?php
  519.   } else {
  520. ?>
  521.       <tr>
  522.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  523.           <tr>
  524.             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  525.               <tr class="dataTableHeadingRow" width="100%">
  526.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PAGES; ?></td>
  527.                 <td class="dataTableHeadingContent"><?php echo TEXT_PAGES_TYPE; ?></td>
  528.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SORT_ORDER; ?></td>
  529.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
  530.                 <td class="dataTableHeadingContent"></td>
  531.                 <td class="dataTableHeadingContent"></td>
  532.               </tr>
  533.  
  534. <?php
  535.     $pages_query_raw = "select
  536.                           p.pages_id,
  537.                           p.status,
  538.                           p.page_type,
  539.                           p.sort_order,
  540.                           s.pages_title
  541.                        from
  542.                           " . TABLE_PAGES . " p LEFT JOIN " .TABLE_PAGES_DESCRIPTION . " s on p.pages_id = s.pages_id
  543.                        where
  544.                           s.language_id='" . (int)$languages_id . "'
  545.                        order by
  546.                           p.sort_order, s.pages_title";
  547.  
  548.  
  549.     $pages_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $pages_query_raw, $pages_query_numrows);
  550.     $pages_query = tep_db_query($pages_query_raw);
  551.     while ($pages = tep_db_fetch_array($pages_query)) {
  552.  
  553.  
  554.  
  555.       if ((!isset($_GET['bID']) || (isset($_GET['bID']) && ($_GET['bID'] == $pages['pages_id']))) && !isset($bInfo) && (substr($action, 0, 3) != 'new')) {
  556.         $bInfo_array = array_merge($pages, (array) $info);
  557.         $bInfo = new objectInfo($bInfo_array);
  558.       }
  559.  
  560.  
  561.       if (isset($bInfo) && is_object($bInfo) && ($pages['pages_id'] == $bInfo->pages_id)) {
  562.         echo '              <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $pages['pages_id']) . '\'">' . "\n";
  563.       } else {
  564.         echo '              <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $pages['pages_id']) . '\'">' . "\n";
  565.       }
  566. ?>
  567.  
  568.  
  569.                     <td class="dataTableContent"><?php echo '<a href="javascript:popupImageWindow(\'' . FILENAME_POPUP_IMAGE . '?page=' . $pages['pages_id'] . '\')">' . tep_image(DIR_WS_IMAGES . 'icon_popup.gif', 'View Page') . '</a>&nbsp;' . $pages['pages_title']; ?></td>
  570.                     <td class="dataTableContent"><?php echo $pages['page_type']; ?></td>
  571.                     <td class="dataTableContent"><?php echo $pages['sort_order']; ?></td>
  572.                     <td class="dataTableContent" align="center">
  573.                       <?php
  574.       if ($pages['status'] == '1') {
  575.         echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', 'Active', 10, 10) . '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $pages['pages_id'] . '&action=setflag&flag=0') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', 'Set Inactive', 10, 10) . '</a>';
  576.       } else {
  577.         echo '<a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $pages['pages_id'] . '&action=setflag&flag=1') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', 'Set Active', 10, 10) . '</a>&nbsp;&nbsp;' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Inactive', 10, 10);
  578.       }
  579. ?>
  580.                     </td>
  581.                     <td class="dataTableContent" align="right"></td>
  582.                     <td class="dataTableContent" align="right"></td>
  583.               </tr>
  584. <?php
  585.     }
  586. ?>
  587.               <tr>
  588.                 <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  589.                   <tr>
  590.                     <td class="smallText" valign="top"><?php echo $pages_split->display_count($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PAGES); ?></td>
  591.                     <td class="smallText" align="right"><?php echo $pages_split->display_links($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
  592.                   </tr>
  593.                   <tr>
  594.                     <td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'action=new') . '">' . tep_image_button('button_new_file.gif', IMAGE_NEW_PAGE) . '</a>'; ?></td>
  595.                   </tr>
  596.                 </table></td>
  597.               </tr>
  598.             </table></td>
  599. <?php
  600.   $heading = array();
  601.   $contents = array();
  602.   switch ($action) {
  603.     case 'delete':
  604.       $heading[] = array('text' => '<b>' . $bInfo->pages_title . '</b>');
  605.  
  606.       $contents = array('form' => tep_draw_form('pages', FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=deleteconfirm'));
  607.       $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
  608.       $contents[] = array('text' => '<br><b>' . $bInfo->pages_title . '</b>');
  609.       if ($bInfo->pages_image) $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('delete_image', 'on', true) . ' ' . TEXT_INFO_DELETE_IMAGE);
  610.       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . '&nbsp;<a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $_GET['bID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  611.       break;
  612.     default:
  613.       if (is_object($bInfo)) {
  614.         $heading[] = array('text' => '<b>' . $bInfo->pages_title . '</b>');
  615.  
  616.         $contents[] = array('align' => 'center', 'text' => '<br><br><a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=new') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_PAGE_MANAGER, 'page=' . $_GET['page'] . '&bID=' . $bInfo->pages_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br><br><br>');
  617.  
  618.         if ($bInfo->date_scheduled) $contents[] = array('text' => '<br>' . sprintf(TEXT_PAGES_SCHEDULED_AT_DATE, tep_date_short($bInfo->date_scheduled)));
  619.  
  620.         if ($bInfo->expires_date) {
  621.           $contents[] = array('text' => '<br>' . sprintf(TEXT_PAGES_EXPIRES_AT_DATE, tep_date_short($bInfo->expires_date)));
  622.         } elseif ($bInfo->expires_impressions) {
  623.           $contents[] = array('text' => '<br>' . sprintf(TEXT_PAGES_EXPIRES_AT_IMPRESSIONS, $bInfo->expires_impressions));
  624.         }
  625.  
  626.         if ($bInfo->date_status_change) $contents[] = array('text' => '<br>' . sprintf(TEXT_PAGES_STATUS_CHANGE, tep_date_short($bInfo->date_status_change)));
  627.       }
  628.       break;
  629.   }
  630.  
  631.   if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
  632.     echo '            <td width="25%" valign="top">' . "\n";
  633.  
  634.     $box = new box;
  635.     echo $box->infoBox($heading, $contents);
  636.  
  637.     echo '            </td>' . "\n";
  638.   }
  639. ?>
  640.           </tr>
  641.         </table></td>
  642.       </tr>
  643. <?php
  644.   }
  645. ?>
  646.     </table></td>
  647. <!-- body_text_eof //-->
  648.   </tr>
  649. </table>
  650. <!-- body_eof //-->
  651.  
  652. <!-- footer //-->
  653. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  654. <!-- footer_eof //-->
  655. <br>
  656. </body>
  657. </html>
  658. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment