diff --git a/README.md b/README.md index 0a95556..47c8f39 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ Contribution: Multi-Language Support for EZ-Pages -Version: 1.5.1.2 -Designed for: Zen Cart v1.5.0 + (merged w/ 1.5.1 files) +Version: 1.7 +Designed for: Zen Cart v1.5.0 + (merged w/ 1.5.5f files) Designed by: Neville Kerr (forum ID: bunyip) -Updated by: Jack Huang (forum ID: neteasy) +Updated by: Zen4All (forum ID: design75) License: under the GPL - See attached License for info. ======================================================== @@ -11,7 +11,7 @@ WHAT DOES THIS CONTRIBUTION DO? This contribution provides multi-language support for the EZ-Pages module that was included in the Zen Cart v1.3.0 release. The standard version does not support more than one language (even though there is a language_id field in the database table). -After installing this module you will be able to enter multi-lingual page/link titles and page content for each EZ-Page from a single admin page (multiple input fields will be present, allowing input for each language just as there is for categories and products). +After installing this module you will be able to enter multi-lingual page/link titles and page content for each EZ-Page from a single admin page (multiple input fields will be present, allowing input for each language just as there is for categories and products). This latest update adds a new page to the Admin panel that simplifies the install/uninstall process and ensures a smooth transition multi-language support. It also provides a fix/repair facility for the new database table to resolve any problems that may have occurred as a result of incomplete installation of the initial release version. @@ -25,14 +25,14 @@ INSTALLATION Step 1. Unzip the archive file Step 2. replace the following two CUSTOM folder with your own folder(template) name - includes\modules\CUSTOM - includes\modules\sideboxes\CUSTOM + includes\modules\YOUR_TEMPLATE + includes\modules\sideboxes\YUOR_TEMPLATE -Step 3. Make a copy of the included file - admin/includes/languages/english/extra_definitions/ezpages_multilanguage_defines.php -and save it as - admin/includes/languages/YOUR_LANGUAGE/extra_definitions/ezpages_multilanguage_defines.php -then edit the two define statements in the file to suit your language. +Step 3. Make a copy of the included file + admin/includes/languages/english/extra_definitions/ezpages_multilanguage_defines.php +and save it as + YOUR_ADMIN/includes/languages/YOUR_LANGUAGE/extra_definitions/ezpages_multilanguage_defines.php +then edit the two define statements in the file to suit your language. Step 4. Transfer all files into your Zen Cart folder. Path names have been included in the archive. @@ -59,6 +59,7 @@ If you installed an earlier version of this contribution, you may experience pro History: +2018-03-19 - v1.7 Multiple updates, zencartcode updated to 1.5.5f/1.5.6 2012-09-26 - minor bugfix for filename and CUSTOM folder 2012-09-21 - updated for Zen Cart v1.5.1 2006-06-09 - v1.0.1 release - included install/repair/uninstall capability @@ -84,9 +85,9 @@ FILES TO OVER-RIDE The following files go into your custom over-ride folders (replace CUSTOM with your own folder name): -includes/modules/CUSTOM/ezpages_bar_footer.php -includes/modules/CUSTOM/ezpages_bar_header.php -includes/modules/sideboxes/CUSTOM/ezpages.php +includes/modules/YOUR_TEMPLATE/ezpages_bar_footer.php +includes/modules/YOUR_TEMPLATE/ezpages_bar_header.php +includes/modules/sideboxes/YOUR_TEMPLATE/ezpages.php ======================================================== @@ -97,4 +98,3 @@ These two files overwrite existing files that don't have an over-ride capability includes/modules/pages/page/header_php.php admin/ezpages.php - diff --git a/admin/ezpages.php b/admin/ezpages.php index 7ad1c55..6025ecc 100644 --- a/admin/ezpages.php +++ b/admin/ezpages.php @@ -1,4 +1,5 @@ Execute("update " . TABLE_EZPAGES . " set " . zen_db_input($status_field) . " = '0' where pages_id = '" . (int)$pages_id . "'"); - } elseif ($status == '0') { - zen_record_admin_activity('EZ-Page ID ' . (int)$pages_id . ' [' . $status_field . '] changed to 1', 'info'); - return $db->Execute("update " . TABLE_EZPAGES . " set " . zen_db_input($status_field) . " = '1' where pages_id = '" . (int)$pages_id . "'"); - } else { - return -1; - } + if ($status == '1') { + zen_record_admin_activity('EZ-Page ID ' . (int)$pages_id . ' [' . $status_field . '] changed to 0', 'info'); + return $db->Execute("UPDATE " . TABLE_EZPAGES . " + SET " . zen_db_input($status_field) . " = 0 + WHERE pages_id = " . (int)$pages_id); + } elseif ($status == '0') { + zen_record_admin_activity('EZ-Page ID ' . (int)$pages_id . ' [' . $status_field . '] changed to 1', 'info'); + return $db->Execute("UPDATE " . TABLE_EZPAGES . " + SET " . zen_db_input($status_field) . " = 1 + WHERE pages_id = " . (int)$pages_id); + } else { + return -1; } +} +require('includes/application_top.php'); - require('includes/application_top.php'); - - if (!isset($_SESSION['ez_sort_order'])) { - $_SESSION['ez_sort_order'] = 0; - } - if (!isset($_GET['reset_ez_sort_order'])) { - $reset_ez_sort_order = $_SESSION['ez_sort_order']; - } +if (!isset($_SESSION['ez_sort_order'])) { + $_SESSION['ez_sort_order'] = 0; +} +if (!isset($_GET['reset_ez_sort_order'])) { + $reset_ez_sort_order = $_SESSION['ez_sort_order']; +} - if ($_GET['action'] == 'set_editor') { - // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly. - $action=''; - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN)); - } +if ($_GET['action'] == 'set_editor') { + // Reset will be done by init_html_editor.php. Now we simply redirect to refresh page properly. + $action = ''; + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN)); +} - $action = (isset($_GET['action']) ? $_GET['action'] : ''); +$action = (isset($_GET['action']) ? $_GET['action'] : ''); - /* BOF Multilingual EZ Pages 1 of 12 */ - $languages = zen_get_languages(); +/* BOF Multilingual EZ Pages 1 of 12 */ +$languages = zen_get_languages(); +/* EOF Multilingual EZ Pages 1 of 12 */ - if (zen_not_null($action)) { - $heading_trailer = ($_GET['ezID'] != '' ? TEXT_INFO_PAGES_ID . (int)$_GET['ezID'] : TEXT_INFO_EZPAGES_CREATE); - } else { - $heading_trailer = TEXT_INFO_PAGES_ID_SELECT; - } - /* EOF Multilingual EZ Pages 1 of 12 */ - - if (zen_not_null($action)) { - switch ($action) { - case 'set_ez_sort_order': - $_SESSION['ez_sort_order'] = $_GET['reset_ez_sort_order']; - $action=''; - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . ($_GET['ezID'] != '' ? '&ezID=' . $_GET['ezID'] : ''))); - break; - /* BOF Multilingual EZ Pages 2 of 12 */ - case 'setflag': - if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) { - zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['flag'])); - $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); - } else { - $messageStack->add(ERROR_UNKNOWN_STATUS_FLAG, 'error'); - } - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . (int)$_GET['page'] . '&ezID=' . (int)$_GET['ezID'])); - break; - /* EOF Multilingual EZ Pages 2 of 12 */ - case 'page_open_new_window': - zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'page_open_new_window'); - $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); - break; - case 'page_is_ssl': - zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'page_is_ssl'); - $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); - break; - case 'status_header': - zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_header'); - $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); - break; - case 'status_sidebox': - zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_sidebox'); - $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); - break; - case 'status_footer': - zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_footer'); - $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); - break; - case 'status_toc': - zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_toc'); +if (zen_not_null($action)) { + switch ($action) { + case 'set_ez_sort_order': + $_SESSION['ez_sort_order'] = $_GET['reset_ez_sort_order']; + $action = ''; + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . ($_GET['ezID'] != '' ? '&ezID=' . $_GET['ezID'] : ''))); + break; + /* BOF Multilingual EZ Pages 2 of 12 */ + case 'setflag': + if (($_GET['flag'] == '0') || ($_GET['flag'] == '1')) { + zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['flag'])); $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); - break; - case 'insert': - case 'update': - if (isset($_POST['pages_id'])) $pages_id = zen_db_prepare_input($_POST['pages_id']); + } else { + $messageStack->add(ERROR_UNKNOWN_STATUS_FLAG, 'error'); + } + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . (int)$_GET['page'] . '&ezID=' . (int)$_GET['ezID'])); + break; + /* EOF Multilingual EZ Pages 2 of 12 */ + case 'page_open_new_window': + zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'page_open_new_window'); + $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); + break; + case 'page_is_ssl': + zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'page_is_ssl'); + $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); + break; + case 'status_header': + zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_header'); + $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); + break; + case 'status_sidebox': + zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_sidebox'); + $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); + break; + case 'status_footer': + zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_footer'); + $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); + break; + case 'status_toc': + zen_set_ezpage_status(zen_db_prepare_input($_GET['ezID']), zen_db_prepare_input($_GET['current']), 'status_toc'); + $messageStack->add(SUCCESS_PAGE_STATUS_UPDATED, 'success'); + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&ezID=' . $_GET['ezID'])); + break; + case 'insert': + case 'update': + if (isset($_POST['pages_id'])) { + $pages_id = zen_db_prepare_input($_POST['pages_id']); + } /* BOF Multilingual EZ Pages 3 of 12 */ - // $pages_title = zen_db_prepare_input($_POST['pages_title']); + //$pages_title = zen_db_prepare_input($_POST['pages_title']); /* EOF Multilingual EZ Pages 3 of 12 */ - $page_open_new_window = (int)$_POST['page_open_new_window']; - $page_is_ssl = (int)$_POST['page_is_ssl']; + $page_open_new_window = (int)$_POST['page_open_new_window']; + $page_is_ssl = (int)$_POST['page_is_ssl']; - $pages_html_text = zen_db_prepare_input($_POST['pages_html_text']); - $alt_url = zen_db_prepare_input($_POST['alt_url']); +/* BOF Multilingual EZ Pages 3 of 12 */ + //$pages_html_text = zen_db_prepare_input($_POST['pages_html_text']); +/* EOF Multilingual EZ Pages 3 of 12 */ + $alt_url = zen_db_prepare_input($_POST['alt_url']); - $alt_url_external = zen_db_prepare_input($_POST['alt_url_external']); + $alt_url_external = zen_db_prepare_input($_POST['alt_url_external']); - $pages_header_sort_order = (int)$_POST['header_sort_order']; - $pages_sidebox_sort_order = (int)$_POST['sidebox_sort_order']; - $pages_footer_sort_order = (int)$_POST['footer_sort_order']; - $pages_toc_sort_order = (int)$_POST['toc_sort_order']; + $pages_header_sort_order = (int)$_POST['header_sort_order']; + $pages_sidebox_sort_order = (int)$_POST['sidebox_sort_order']; + $pages_footer_sort_order = (int)$_POST['footer_sort_order']; + $pages_toc_sort_order = (int)$_POST['toc_sort_order']; - $toc_chapter = (int)$_POST['toc_chapter']; + $toc_chapter = (int)$_POST['toc_chapter']; - $status_header = ($pages_header_sort_order == 0 ? 0 : (int)$_POST['status_header']); - $status_sidebox = ($pages_sidebox_sort_order == 0 ? 0 : (int)$_POST['status_sidebox']); - $status_footer = ($pages_footer_sort_order == 0 ? 0 : (int)$_POST['status_footer']); - $status_toc = ($pages_toc_sort_order == 0 ? 0 : (int)$_POST['status_toc']); + $status_header = ($pages_header_sort_order == 0 ? 0 : (int)$_POST['status_header']); + $status_sidebox = ($pages_sidebox_sort_order == 0 ? 0 : (int)$_POST['status_sidebox']); + $status_footer = ($pages_footer_sort_order == 0 ? 0 : (int)$_POST['status_footer']); + $status_toc = ($pages_toc_sort_order == 0 ? 0 : (int)$_POST['status_toc']); -/* BOF Multilingual EZ Pages 4 of 12 */ - $pages_html_url_flag = false; - $languages = zen_get_languages(); - for ($i=0, $n=sizeof($languages); $i<$n; $i++) { - if ($_POST['pages_html_text'][$languages[$i]['id']] !='' && strlen(trim($_POST['pages_html_text'][$languages[$i]['id']])) > 6) { - $pages_html_url_flag = true; - } - $page_error = false; - if (empty($_POST['pages_title'][$languages[$i]['id']])) { - $messageStack->add(ERROR_PAGE_TITLE_REQUIRED . ' (' . $languages[$i]['name'] . ')', 'error'); - $page_error = true; - } - if (empty($pages_html_text)) { - } - } -/* EOF Multilingual EZ Pages 4 of 12 */ - $zv_link_method_cnt = 0; - if ($alt_url !='') { - $zv_link_method_cnt++; + /* BOF Multilingual EZ Pages 4 of 12 */ + $pages_html_url_flag = false; + for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { + if ($_POST['pages_html_text'][$languages[$i]['id']] != '' && strlen(trim($_POST['pages_html_text'][$languages[$i]['id']])) > 6) { + $pages_html_url_flag = true; } - if ($alt_url_external !='') { - $zv_link_method_cnt++; + $page_error = false; + if (empty($_POST['pages_title'][$languages[$i]['id']])) { + $messageStack->add(ERROR_PAGE_TITLE_REQUIRED . ' (' . $languages[$i]['name'] . ')', 'error'); + $page_error = true; } - if ($pages_html_text !='' and strlen(trim($pages_html_text)) > 6) { - $zv_link_method_cnt++; + if (empty($pages_html_text)) { + } - if ($zv_link_method_cnt > 1) { - $messageStack->add(ERROR_MULTIPLE_HTML_URL, 'error'); - $page_error = true; + } + /* EOF Multilingual EZ Pages 4 of 12 */ + $zv_link_method_cnt = 0; + if ($alt_url != '') { + $zv_link_method_cnt++; + } + if ($alt_url_external != '') { + $zv_link_method_cnt++; + } + // BOF Zen4All update, code fix for warning on expecting string and getting an arry + for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { + if ($pages_html_text[$languages[$i]['id']] != '' && strlen(trim($pages_html_text[$languages[$i]['id']])) > 6) { + $pages_html_text_count = $i + 1; } + } + // EOF Zen4All update + if ($pages_html_text_count > 0) { + $zv_link_method_cnt++; + } + if ($zv_link_method_cnt > 1) { + $messageStack->add(ERROR_MULTIPLE_HTML_URL, 'error'); + $page_error = true; + } - if ($page_error == false) { - $sql_data_array = array('pages_title' => $pages_title, - 'page_open_new_window' => $page_open_new_window, - 'page_is_ssl' => $page_is_ssl, - 'alt_url' => $alt_url, - 'alt_url_external' => $alt_url_external, - 'status_header' => $status_header, - 'status_sidebox' => $status_sidebox, - 'status_footer' => $status_footer, - 'status_toc' => $status_toc, - 'header_sort_order' => $pages_header_sort_order, - 'sidebox_sort_order' => $pages_sidebox_sort_order, - 'footer_sort_order' => $pages_footer_sort_order, - 'toc_sort_order' => $pages_toc_sort_order, - 'toc_chapter' => $toc_chapter, - 'pages_html_text' => $pages_html_text); - - if ($action == 'insert') { - zen_db_perform(TABLE_EZPAGES, $sql_data_array); - $pages_id = $db->insert_ID(); - /* BOF Multilingual EZ Pages 5 of 12 */ - $pages_title_array = zen_db_prepare_input($_POST['pages_title']); - $pages_html_text_array = zen_db_prepare_input($_POST['pages_html_text']); - for ($i=0, $n = sizeof($languages); $i<$n; $i++) { - $language_id = $languages[$i]['id']; - $sql_data_array = array('pages_title' => $pages_title_array[$language_id], - 'pages_html_text' => $pages_html_text_array[$language_id], - 'languages_id' => (int)$language_id, - 'pages_id' => (int)$pages_id); - - zen_db_perform(TABLE_EZPAGES_TEXT, $sql_data_array); - } - /* EOF Multilingual EZ Pages 5 of 12 */ - $messageStack->add(SUCCESS_PAGE_INSERTED, 'success'); - zen_record_admin_activity('EZ-Page with ID ' . (int)$pages_id . ' added.', 'info'); - } elseif ($action == 'update') { - zen_db_perform(TABLE_EZPAGES, $sql_data_array, 'update', "pages_id = '" . (int)$pages_id . "'"); - /* BOF Multilingual EZ Pages 6 of 12 */ - $pages_title_array = zen_db_prepare_input($_POST['pages_title']); - $pages_html_text_array = zen_db_prepare_input($_POST['pages_html_text']); - for ($i=0, $n = sizeof($languages); $i<$n; $i++) { - $language_id = $languages[$i]['id']; - $sql_data_array = array('pages_title' => $pages_title_array[$language_id], - 'pages_html_text' => $pages_html_text_array[$language_id]); - - zen_db_perform(TABLE_EZPAGES_TEXT, $sql_data_array, 'update', "pages_id = '" . (int)$pages_id . "' and languages_id = '" . $language_id . "'"); - } - /* EOF Multilingual EZ Pages 6 of 12 */ - $messageStack->add(SUCCESS_PAGE_UPDATED, 'success'); - zen_record_admin_activity('EZ-Page with ID ' . (int)$pages_id . ' updated.', 'info'); + if ($page_error == false) { + $sql_data_array = array( + //'pages_title' => $pages_title, + 'page_open_new_window' => $page_open_new_window, + 'page_is_ssl' => $page_is_ssl, + 'alt_url' => $alt_url, + 'alt_url_external' => $alt_url_external, + 'status_header' => $status_header, + 'status_sidebox' => $status_sidebox, + 'status_footer' => $status_footer, + 'status_toc' => $status_toc, + 'header_sort_order' => $pages_header_sort_order, + 'sidebox_sort_order' => $pages_sidebox_sort_order, + 'footer_sort_order' => $pages_footer_sort_order, + 'toc_sort_order' => $pages_toc_sort_order, + 'toc_chapter' => $toc_chapter, + //'pages_html_text' => $pages_html_text + ); + + if ($action == 'insert') { + zen_db_perform(TABLE_EZPAGES, $sql_data_array); + $pages_id = $db->insert_ID(); + /* BOF Multilingual EZ Pages 6 of 12 */ + $pages_title_array = zen_db_prepare_input($_POST['pages_title']); + $pages_html_text_array = zen_db_prepare_input($_POST['pages_html_text']); + for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { + $language_id = $languages[$i]['id']; + $sql_data_array = array( + 'pages_title' => $pages_title_array[$language_id], + 'pages_html_text' => $pages_html_text_array[$language_id], + 'languages_id' => (int)$language_id, + 'pages_id' => (int)$pages_id); + + zen_db_perform(TABLE_EZPAGES_TEXT, $sql_data_array); + } + /* EOF Multilingual EZ Pages 6 of 12 */ + $messageStack->add(SUCCESS_PAGE_INSERTED, 'success'); + zen_record_admin_activity('EZ-Page with ID ' . (int)$pages_id . ' added.', 'info'); + } elseif ($action == 'update') { + zen_db_perform(TABLE_EZPAGES, $sql_data_array, 'update', "pages_id = " . (int)$pages_id); + /* BOF Multilingual EZ Pages 7 of 12 */ + $pages_title_array = zen_db_prepare_input($_POST['pages_title']); + $pages_html_text_array = zen_db_prepare_input($_POST['pages_html_text']); + for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { + $language_id = $languages[$i]['id']; + $sql_data_array = array( + 'pages_title' => $pages_title_array[$language_id], + 'pages_html_text' => $pages_html_text_array[$language_id]); + + zen_db_perform(TABLE_EZPAGES_TEXT, $sql_data_array, 'update', "pages_id = " . (int)$pages_id . " and languages_id = " . (int)$language_id); } + /* EOF Multilingual EZ Pages 7 of 12 */ + $messageStack->add(SUCCESS_PAGE_UPDATED, 'success'); + zen_record_admin_activity('EZ-Page with ID ' . (int)$pages_id . ' updated.', 'info'); + } - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'ezID=' . $pages_id)); + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'ezID=' . $pages_id)); + } else { + if ($page_error == false) { + $action = 'new'; } else { - if ($page_error == false) { - $action = 'new'; - } else { - $_GET['pages_id'] = $pages_id; - $_GET['ezID'] = $pages_id; - $_GET['action'] = 'new'; - $action = 'new'; - $ezID = $pages_id; - $page = $_GET['page']; - } + $_GET['pages_id'] = $pages_id; + $_GET['ezID'] = $pages_id; + $_GET['action'] = 'new'; + $action = 'new'; + $ezID = $pages_id; } - break; - case 'deleteconfirm': - $pages_id = zen_db_prepare_input($_POST['ezID']); - $db->Execute("delete from " . TABLE_EZPAGES . " where pages_id = '" . (int)$pages_id . "'"); - /* BOF Multilingual EZ Pages 7 of 12 */ - $db->Execute("delete from " . TABLE_EZPAGES_TEXT . " where pages_id = '" . (int)$pages_id . "'"); - /* EOF Multilingual EZ Pages 7 of 12 */ - $messageStack->add(SUCCESS_PAGE_REMOVED, 'success'); - zen_record_admin_activity('EZ-Page with ID ' . (int)$pages_id . ' deleted.', 'notice'); - zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'])); - break; - } + } + break; + case 'deleteconfirm': + $pages_id = zen_db_prepare_input($_POST['ezID']); + $db->Execute("DELETE FROM " . TABLE_EZPAGES . " + WHERE pages_id = " . (int)$pages_id); + /* BOF Multilingual EZ Pages 8 of 12 */ + $db->Execute("DELETE FROM " . TABLE_EZPAGES_TEXT . " + WHERE pages_id = " . (int)$pages_id); + /* EOF Multilingual EZ Pages 8 of 12 */ + $messageStack->add(SUCCESS_PAGE_REMOVED, 'success'); + zen_record_admin_activity('EZ-Page with ID ' . (int)$pages_id . ' deleted.', 'notice'); + zen_redirect(zen_href_link(FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'])); + break; } +} ?> - + > - - -<?php echo TITLE; ?> - - - - - - - - - - - - - - - - - -
- - - - '', // Multilingual EZ Pages 8 of 12 - 'page_open_new_window' => '', - 'page_is_ssl' => '', - 'pages_html_text' => '', - 'alt_url' => '', - 'alt_url_external' => '', - 'header_sort_order' => '', - 'sidebox_sort_order' => '', - 'footer_sort_order' => '', - 'toc_sort_order' => '', - 'toc_chapter' => '', - 'status_header' => '', - 'status_sidebox' => '', - 'status_footer' => '', - 'status_toc' => '', - 'page_open_new_window' => '', - 'page_is_ssl' => '' - ); - - $ezInfo = new objectInfo($parameters); - - if (isset($_GET['ezID'])) { - $form_action = 'update'; - - $ezID = zen_db_prepare_input($_GET['ezID']); - - $page_query = "select * from " . TABLE_EZPAGES . " where pages_id = '" . (int)$_GET['ezID'] . "'"; - $page = $db->Execute($page_query); - $ezInfo->updateObjectInfo($page->fields); - } elseif (zen_not_null($_POST)) { - $ezInfo->updateObjectInfo($_POST); - } + echo TEXT_EDITOR_INFO . zen_draw_form('set_editor_form', FILENAME_EZPAGES_ADMIN, '', 'get') . '  ' . zen_draw_pull_down_menu('reset_editor', $editors_pulldown, $current_editor_key, 'onChange="this.form.submit();"') . + zen_hide_session_id() . + zen_draw_hidden_field('action', 'set_editor') . + ''; + } + ?> + + + '', + 'pages_html_text' => '', + 'alt_url' => '', + 'alt_url_external' => '', + 'header_sort_order' => '', + 'sidebox_sort_order' => '', + 'footer_sort_order' => '', + 'toc_sort_order' => '', + 'toc_chapter' => '', + 'status_header' => '1', + 'status_sidebox' => '1', + 'status_footer' => '1', + 'status_toc' => '1', + 'page_open_new_window' => '1', + 'page_is_ssl' => '1' + ); + + $ezInfo = new objectInfo($parameters); + + if (isset($_GET['ezID'])) { + $form_action = 'update'; + + $ezID = zen_db_prepare_input($_GET['ezID']); + + $page_query = "SELECT * + FROM " . TABLE_EZPAGES . " + WHERE pages_id = " . (int)$_GET['ezID']; + $page = $db->Execute($page_query); + $ezInfo->updateObjectInfo($page->fields); + } elseif (zen_not_null($_POST)) { + $ezInfo->updateObjectInfo($_POST); + } + ?> + -// set all status settings and switches - if (!isset($ezInfo->status_header)) $ezInfo->status_header = '1'; - switch ($ezInfo->status_header) { - case '0': $is_status_header = false; $not_status_header = true; break; - case '1': $is_status_header = true; $not_status_header = false; break; - default: $is_status_header = true; $not_status_header = false; break; - } - if (!isset($ezInfo->status_sidebox)) $ezInfo->status_sidebox = '1'; - switch ($ezInfo->status_sidebox) { - case '0': $is_status_sidebox = false; $not_status_sidebox = true; break; - case '1': $is_status_sidebox = true; $not_status_sidebox = false; break; - default: $is_status_sidebox = true; $not_status_sidebox = false; break; - } - if (!isset($ezInfo->status_footer)) $ezInfo->status_footer = '1'; - switch ($ezInfo->status_footer) { - case '0': $is_status_footer = false; $not_status_footer = true; break; - case '1': $is_status_footer = true; $not_status_footer = false; break; - default: $is_status_footer = true; $not_status_footer = false; break; - } - if (!isset($ezInfo->status_toc)) $ezInfo->status_toc = '1'; - switch ($ezInfo->status_toc) { - case '0': $is_status_toc = false; $not_status_toc = true; break; - case '1': $is_status_toc = true; $not_status_toc = false; break; - default: $is_status_toc = true; $not_status_toc = false; break; - } - if (!isset($ezInfo->page_open_new_window)) $ezInfo->not_page_open_new_window = '1'; - switch ($ezInfo->page_open_new_window) { - case '0': $is_page_open_new_window = false; $not_page_open_new_window = true; break; - case '1': $is_page_open_new_window = true; $not_page_open_new_window = false; break; - default: $is_page_open_new_window = false; $not_page_open_new_window = true; break; - } - if (!isset($ezInfo->page_is_ssl)) $ezInfo->page_is_ssl = '1'; - switch ($ezInfo->page_is_ssl) { - case '0': $is_page_is_ssl = false; $not_page_is_ssl = true; break; - case '1': $is_page_is_ssl = true; $not_page_is_ssl = false; break; - default: $is_page_is_ssl = false; $not_page_is_ssl = true; break; - } -?> - - - - - - - - - - - - - - - - - - - - ' . "\n"; - } -?> - -
- - - - - - -
- + + + + + +
+

+
+ + '0', 'text' => TEXT_SORT_CHAPTER_TOC_TITLE), - array('id' => '1', 'text' => TEXT_SORT_HEADER_TITLE), - array('id' => '2', 'text' => TEXT_SORT_SIDEBOX_TITLE), - array('id' => '3', 'text' => TEXT_SORT_FOOTER_TITLE), - array('id' => '4', 'text' => TEXT_SORT_PAGE_TITLE), - array('id' => '5', 'text' => TEXT_SORT_PAGE_ID_TITLE) - ); - echo TEXT_SORT_CHAPTER_TOC_TITLE_INFO . zen_draw_form('set_ez_sort_order_form', FILENAME_EZPAGES_ADMIN, '', 'get') . '  ' . zen_draw_pull_down_menu('reset_ez_sort_order', $ez_sort_order_array, $reset_ez_sort_order, 'onChange="this.form.submit();"') . zen_hide_session_id() . - ($_GET['page'] != '' ? zen_draw_hidden_field('page', $_GET['page']) : '') . - zen_draw_hidden_field('action', 'set_ez_sort_order') . - ''; -?> -
- '0', 'text' => TEXT_SORT_CHAPTER_TOC_TITLE), + array('id' => '1', 'text' => TEXT_SORT_HEADER_TITLE), + array('id' => '2', 'text' => TEXT_SORT_SIDEBOX_TITLE), + array('id' => '3', 'text' => TEXT_SORT_FOOTER_TITLE), + array('id' => '4', 'text' => TEXT_SORT_PAGE_TITLE), + array('id' => '5', 'text' => TEXT_SORT_PAGE_ID_TITLE) + ); + ?> +
+ + + + + + '; ?> +
+
+ '; - } -?> -
- - - -
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
- - +
+ -
+
+ Execute($title_query_sql); + $pages_title = $title_query->fields['pages_title']; + } else { + $pages_title = ''; + } + echo '
'; + echo '' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ''; + echo zen_draw_input_field('pages_title[' . $languages[$i]['id'] . ']', htmlspecialchars($pages_title, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_EZPAGES_TEXT, 'pages_title') . 'class="form-control"', true); + echo '
'; + echo '
'; + } + ?> +
- - - - - - - - - - - - - - - - - - - - - - + +
+ +
+ +
+
+
+ +
+ + +
+
+
+
+
+
+ + + +
+ + header_sort_order, zen_set_field_length(TABLE_EZPAGES, 'header_sort_order') . ' class="form-control"', false); ?> +
+
+
+ + + +
+ + sidebox_sort_order, zen_set_field_length(TABLE_EZPAGES, 'sidebox_sort_order') . ' class="form-control"', false); ?> +
+
+
+ + + +
+ + footer_sort_order, zen_set_field_length(TABLE_EZPAGES, 'footer_sort_order') . ' class="form-control"', false); ?> +
+
+
+ + toc_chapter, zen_set_field_length(TABLE_EZPAGES, 'toc_chapter', '6') . ' class="form-control"', false); ?> +
+ + + +
+ + toc_sort_order, zen_set_field_length(TABLE_EZPAGES, 'toc_sort_order') . ' class="form-control"', false); ?> +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+
+
+ -
- - - - - - - - - - - - - - - - - - - - - - - - - -
-Execute($title_query_sql); - $pages_title = $title_query->fields['pages_title']; - } else { - $pages_title = ''; - } - echo '
' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' '; - echo zen_draw_input_field('pages_title[' . $languages[$i]['id'] . ']', htmlspecialchars($pages_title, ENT_COMPAT, CHARSET, TRUE),zen_set_field_length(TABLE_EZPAGES_TEXT, 'pages_title'), true); - } -?> -
- - - - -
-
- ' . zen_draw_radio_field('page_open_new_window', '0', $not_page_open_new_window) . ' ' . TEXT_NO; ?> -
-
- ' . zen_draw_radio_field('page_is_ssl', '0', $not_page_is_ssl) . ' ' . TEXT_NO; ?> -
- - - - - - - - - - - - - - - - - - - -
-
- ' . zen_draw_radio_field('status_header', '0', $not_status_header) . ' ' . TEXT_NO; ?> -
-
- header_sort_order, zen_set_field_length(TABLE_EZPAGES, 'header_sort_order'), false); ?> -
   -
- ' . zen_draw_radio_field('status_sidebox', '0', $not_status_sidebox) . ' ' . TEXT_NO; ?> -
-
- sidebox_sort_order, zen_set_field_length(TABLE_EZPAGES, 'sidebox_sort_order'), false); ?> -
   -
- ' . zen_draw_radio_field('status_footer', '0', $not_status_footer) . ' ' . TEXT_NO; ?> -
-
- footer_sort_order, zen_set_field_length(TABLE_EZPAGES, 'footer_sort_order'), false); ?> -
   - - toc_chapter, zen_set_field_length(TABLE_EZPAGES, 'toc_chapter', '6'), false); ?> - -
- ' . zen_draw_radio_field('status_toc', '0', $not_status_toc) . ' ' . TEXT_NO; ?> -
-
- toc_sort_order, zen_set_field_length(TABLE_EZPAGES, 'toc_sort_order'), false); ?> -
- '; ?> - '; ?> - '; ?> - '; ?> - -
- -Execute($text_query_sql); - $pages_html_text = $text_query->fields['pages_html_text']; +
+ Execute($text_query_sql); + $pages_html_text = $text_query->fields['pages_html_text']; + } else { + $pages_html_text = ''; + } + ?> +
+ + +
+
+ +
+ + +
+ +
alt_url, 'size="100" class="form-control"'); ?>
+
+
+ +
alt_url_external, 'size="100" class="form-control"'); ?>
+
+
+
' . IMAGE_INSERT . '' : '') . ' ' . IMAGE_CANCEL . ''; ?>
+
+ '; ?> + ' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' '; - echo zen_draw_textarea_field('pages_html_text[' . $languages[$i]['id'] . ']', 'soft', '100%', '20', $pages_html_text); - } -?> -
alt_url, 'size="100"'); - echo '
' . TEXT_ALT_URL_EXPLAIN; - ?>
alt_url_external, 'size="100"'); - echo '
' . TEXT_ALT_URL_EXTERNAL_EXPLAIN; - ?>
- - - -
' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
- - - '' . $ezInfo->pages_title . ''); - - $contents = array('form' => zen_draw_form('pages', FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&action=deleteconfirm') . zen_draw_hidden_field('ezID', $ezInfo->pages_id)); - $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); - $contents[] = array('text' => '
' . $ezInfo->pages_title . ''); - - $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); - break; - default: - if (is_object($ezInfo)) { - $heading[] = array('text' => '' . TEXT_PAGE_TITLE . ' ' . $ezInfo->pages_title . ' | ' . TEXT_CHAPTER . ' ' . $ezInfo->toc_chapter . ''); - - $zv_link_method_cnt = 0; - if ($ezInfo->alt_url !='') { - $zv_link_method_cnt++; - } - if ($ezInfo->alt_url_external !='') { - $zv_link_method_cnt++; - } - if ($ezInfo->pages_html_text !='' and strlen(trim($ezInfo->pages_html_text)) > 6) { - $zv_link_method_cnt++; - } - - if ($zv_link_method_cnt > 1) { - $contents[] = array('align' => 'left', 'text' => zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED_EZPAGES, 10, 10) . '  ' . TEXT_WARNING_MULTIPLE_SETTINGS); - } - - $contents[] = array('align' => 'left', 'text' => TEXT_ALT_URL . (empty($ezInfo->alt_url) ? ' ' . TEXT_NONE : '
' . $ezInfo->alt_url)); - $contents[] = array('align' => 'left', 'text' => '
' . TEXT_ALT_URL_EXTERNAL . (empty($ezInfo->alt_url_external) ? ' ' . TEXT_NONE : '
' . $ezInfo->alt_url_external)); - $contents[] = array('align' => 'left', 'text' => '
' . TEXT_PAGES_HTML_TEXT . '
' . substr(strip_tags($ezInfo->pages_html_text),0,100)); - - $contents[] = array('align' => 'left', 'text' => '
' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '


'); - - if ($ezInfo->date_scheduled) $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_SCHEDULED_AT_DATE, zen_date_short($ezInfo->date_scheduled))); - - if ($ezInfo->expires_date) { - $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_EXPIRES_AT_DATE, zen_date_short($ezInfo->expires_date))); - } elseif ($ezInfo->expires_impressions) { - $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_EXPIRES_AT_IMPRESSIONS, $ezInfo->expires_impressions)); - } - - if ($ezInfo->date_status_change) $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_STATUS_CHANGE, zen_date_short($ezInfo->date_status_change))); + + +
- - - - - - - - - - - - - - +
+
+
 
+ + + + + + + + + + + + + + + + + Execute($pages_query_raw); - $check_count=1; - if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) { - while (!$check_page->EOF) { - if ($check_page->fields['customers_id'] == $_GET['cID']) { - break; - } - $check_count++; - $check_page->MoveNext(); - } - $_GET['page'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS_EZPAGE)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) !=0 ? .5 : 0)),0); - } else { - $_GET['page'] = 1; - } -} - - $pages_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, $pages_query_raw, $pages_query_numrows); - $pages = $db->Execute($pages_query_raw); - -while (!$pages->EOF) { - if ((!isset($_GET['ezID']) || (isset($_GET['ezID']) && ($_GET['ezID'] == $pages->fields['pages_id']))) && !isset($ezInfo) && (substr($action, 0, 3) != 'new')) { - $ezInfo_array = $pages->fields; - $ezInfo = new objectInfo($ezInfo_array); - } - $zv_link_method_cnt = 0; - if ($pages->fields['alt_url'] !='') { - $zv_link_method_cnt++; - } - if ($pages->fields['alt_url_external'] !='') { - $zv_link_method_cnt++; - } - if ($pages->fields['pages_html_text'] !='' and strlen(trim($pages->fields['pages_html_text'])) > 6) { - $zv_link_method_cnt++; - } - if (isset($ezInfo) && is_object($ezInfo) && ($pages->fields['pages_id'] == $ezInfo->pages_id)) { - echo ' ' . "\n"; - } else { - echo ' ' . "\n"; - } -?> - - - - - - - - - - - -MoveNext(); - } -?> - - - - + if (($_GET['page'] == '' or $_GET['page'] == '1') && $_GET['ezID'] != '') { + $check_page = $db->Execute($pages_query_raw); + $check_count = 1; + if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) { + foreach ($check_page as $item) { + if ($item['customers_id'] == $_GET['cID']) { + break; + } + $check_count++; + } + $_GET['page'] = round((($check_count / MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) + (fmod_round($check_count, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE) != 0 ? .5 : 0)), 0); + } else { + $_GET['page'] = 1; + } + } + + $pages_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, $pages_query_raw, $pages_query_numrows); + $pages = $db->Execute($pages_query_raw); + + foreach ($pages as $page) { + if ((!isset($_GET['ezID']) || (isset($_GET['ezID']) && ($_GET['ezID'] == $page['pages_id']))) && !isset($ezInfo) && (substr($action, 0, 3) != 'new')) { + $ezInfo_array = $page; + $ezInfo = new objectInfo($ezInfo_array); + } + $zv_link_method_cnt = 0; + if ($page['alt_url'] != '') { + $zv_link_method_cnt++; + } + if ($page['alt_url_external'] != '') { + $zv_link_method_cnt++; + } + if ($page['pages_html_text'] != '' && strlen(trim($page['pages_html_text'])) > 6) { + $zv_link_method_cnt++; + } + if (isset($ezInfo) && is_object($ezInfo) && ($page['pages_id'] == $ezInfo->pages_id)) { + ?> + + + + + + + + + + + + + + - - - - -
 
1 ? zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED_EZPAGES, 10, 10) : '') . ' ' . $pages->fields['pages_id']; ?>fields['pages_title']; ?>fields['page_open_new_window'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?>fields['page_is_ssl'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?>fields['header_sort_order'] . ' ' . ($pages->fields['status_header'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?>fields['sidebox_sort_order'] . ' ' . ($pages->fields['status_sidebox'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?>fields['footer_sort_order'] . ' ' . ($pages->fields['status_footer'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?>fields['toc_chapter']; ?>fields['toc_sort_order'] . ' ' . ($pages->fields['status_toc'] == 1 ? '' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?>  fields['pages_id'] == $ezInfo->pages_id)) ? 'ezID=' . $pages->fields['pages_id'] . '&action=new' : '') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ''; ?>fields['pages_id'] == $ezInfo->pages_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?>
display_count($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PAGES); ?>display_links($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'ezID'))); ?>
1 ? zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED_EZPAGES, 10, 10) : '') . ' ' . $page['pages_id']; ?> 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?> 0 ? '&page=' . $_GET['page'] : ''), 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . 'icon_green_on.gif', IMAGE_ICON_STATUS_ON) . '' : '' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . ''); ?>pages_id)) ? 'ezID=' . $page['pages_id'] . '&action=new' : '') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ''; ?> + pages_id)) { + echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); + } else { + echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; + } + ?> +
- - - -
' . zen_image_button('button_new_file.gif', IMAGE_NEW_PAGE) . ''; ?>
+ +
+ '

' . $ezInfo->pages_title . '

'); + + $contents = array('form' => zen_draw_form('pages', FILENAME_EZPAGES_ADMIN, 'page=' . $_GET['page'] . '&action=deleteconfirm') . zen_draw_hidden_field('ezID', $ezInfo->pages_id)); + $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); + $contents[] = array('text' => '
' . $ezInfo->pages_title . ''); + + $contents[] = array('align' => 'center', 'text' => '
' . IMAGE_CANCEL . ''); + break; + default: + if (is_object($ezInfo)) { + $heading[] = array('text' => '

' . TEXT_PAGE_TITLE . ' ' . $ezInfo->pages_title . ' | ' . TEXT_CHAPTER . ' ' . $ezInfo->toc_chapter . '

'); + + $zv_link_method_cnt = 0; + if ($ezInfo->alt_url != '') { + $zv_link_method_cnt++; + } + if ($ezInfo->alt_url_external != '') { + $zv_link_method_cnt++; + } + if ($ezInfo->pages_html_text != '' && strlen(trim($ezInfo->pages_html_text)) > 6) { + $zv_link_method_cnt++; + } + + if ($zv_link_method_cnt > 1) { + $contents[] = array('text' => zen_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED_EZPAGES, 10, 10) . '  ' . TEXT_WARNING_MULTIPLE_SETTINGS); + } + + $contents[] = array('text' => TEXT_ALT_URL . (empty($ezInfo->alt_url) ? ' ' . TEXT_NONE : '
' . $ezInfo->alt_url)); + $contents[] = array('text' => '
' . TEXT_ALT_URL_EXTERNAL . (empty($ezInfo->alt_url_external) ? ' ' . TEXT_NONE : '
' . $ezInfo->alt_url_external)); + $contents[] = array('text' => '
' . TEXT_PAGES_HTML_TEXT . '
' . substr(strip_tags($ezInfo->pages_html_text), 0, 100)); + + $contents[] = array('align' => 'text-center', 'text' => '
' . IMAGE_EDIT . ' ' . IMAGE_DELETE . '


'); + + if ($ezInfo->date_scheduled) { + $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_SCHEDULED_AT_DATE, zen_date_short($ezInfo->date_scheduled))); + } + + if ($ezInfo->expires_date) { + $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_EXPIRES_AT_DATE, zen_date_short($ezInfo->expires_date))); + } elseif ($ezInfo->expires_impressions) { + $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_EXPIRES_AT_IMPRESSIONS, $ezInfo->expires_impressions)); + } + + if ($ezInfo->date_status_change) { + $contents[] = array('text' => '
' . sprintf(TEXT_PAGES_STATUS_CHANGE, zen_date_short($ezInfo->date_status_change))); + } + } + break; + } + + if ((zen_not_null($heading)) && (zen_not_null($contents))) { + $box = new box; + echo $box->infoBox($heading, $contents); + } + ?> +
+ +
+ + + + + + + + +
display_count($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_PAGES); ?>display_links($pages_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_EZPAGE, MAX_DISPLAY_PAGE_LINKS, $_GET['page'], zen_get_all_get_params(array('page', 'info', 'x', 'y', 'ezID'))); ?>
+
+ ' . "\n"; - - $box = new box; - echo $box->infoBox($heading, $contents); - - echo '
- - - - - - - - -
- + ?> + + + + + + + + - \ No newline at end of file + diff --git a/admin/ezpages_install.php b/admin/ezpages_install.php index a9061a1..adcf2f1 100644 --- a/admin/ezpages_install.php +++ b/admin/ezpages_install.php @@ -18,6 +18,7 @@ * | license@zen-cart.com so we can mail you a copy immediately. | * +----------------------------------------------------------------------+ * $Id: ezpages_install.php 2006-06-09 bunyip $ + * Update 2018-03-19 Zen4All * install/repair/uninstall utility for multi-language EZ-Pages contribution */ @@ -71,9 +72,9 @@ } $sql = "SELECT * - FROM " . TABLE_EZPAGES_TEXT . " - WHERE pages_id = " . (int) $pages->fields['pages_id'] . " - AND languages_id = " . (int) $languages[$i]['id']; + FROM " . TABLE_EZPAGES_TEXT . " + WHERE pages_id = " . (int) $pages->fields['pages_id'] . " + AND languages_id = " . (int) $languages[$i]['id']; $check_query = $db->Execute($sql); @@ -104,8 +105,9 @@ $pages_html_text = (zen_not_null($check_query->fields['pages_html_text']) ? $check_query->fields['pages_html_text'] : $pages_html_text); } - $sql_update_array = array('pages_title' => $pages_title, - 'pages_html_text' => $pages_html_text); + $sql_update_array = array( + 'pages_title' => $pages_title, + 'pages_html_text' => $pages_html_text); zen_db_perform(TABLE_EZPAGES_TEXT, $sql_update_array, 'update', "pages_id = '" . (int) $pages->fields['pages_id'] . "' and languages_id = '" . (int) $languages[$i]['id'] . "'"); } @@ -129,8 +131,9 @@ while (!$pages_query->EOF) { - $sql_update_array = array('pages_title' => $pages_query->fields['pages_title'], - 'pages_html_text' => $pages_query->fields['pages_html_text']); + $sql_update_array = array( + 'pages_title' => $pages_query->fields['pages_title'], + 'pages_html_text' => $pages_query->fields['pages_html_text']); zen_db_perform(TABLE_EZPAGES, $sql_update_array, 'update', 'pages_id = ' . $pages_query->fields['pages_id']); @@ -152,7 +155,6 @@ diff --git a/includes/modules/YOUR_TEMPLATE/ezpages_bar_footer.php b/includes/modules/YOUR_TEMPLATE/ezpages_bar_footer.php index 7fca01e..ed737c5 100644 --- a/includes/modules/YOUR_TEMPLATE/ezpages_bar_footer.php +++ b/includes/modules/YOUR_TEMPLATE/ezpages_bar_footer.php @@ -22,9 +22,10 @@ } /* BOF Multilingual EZ Pages 1 of 1 */ $page_query = $db->Execute("SELECT e.*, et.* - FROM " . TABLE_EZPAGES . " e, " . TABLE_EZPAGES_TEXT . " et + FROM " . TABLE_EZPAGES . " e, + " . TABLE_EZPAGES_TEXT . " et WHERE e.pages_id = et.pages_id - AND et.languages_id = '" . (int)$_SESSION['languages_id'] . "' + AND et.languages_id = " . (int)$_SESSION['languages_id'] . " AND e.status_footer = 1 AND e.footer_sort_order > 0 ORDER BY e.footer_sort_order, et.pages_title"); diff --git a/includes/modules/YOUR_TEMPLATE/ezpages_bar_header.php b/includes/modules/YOUR_TEMPLATE/ezpages_bar_header.php index de33a3f..bf5e19a 100644 --- a/includes/modules/YOUR_TEMPLATE/ezpages_bar_header.php +++ b/includes/modules/YOUR_TEMPLATE/ezpages_bar_header.php @@ -21,9 +21,10 @@ } /* BOF Multilingual EZ Pages 1 of 1 */ $page_query = $db->Execute("SELECT e.*, et.* - FROM " . TABLE_EZPAGES . " e, " . TABLE_EZPAGES_TEXT . " et + FROM " . TABLE_EZPAGES . " e, + " . TABLE_EZPAGES_TEXT . " et WHERE e.pages_id = et.pages_id - AND et.languages_id = '" . (int)$_SESSION['languages_id'] . "' + AND et.languages_id = " . (int)$_SESSION['languages_id'] . " AND e.status_header = 1 AND e.header_sort_order > 0 ORDER BY e.header_sort_order, et.pages_title"); diff --git a/includes/modules/pages/page/header_php.php b/includes/modules/pages/page/header_php.php index 698c4a9..146844f 100644 --- a/includes/modules/pages/page/header_php.php +++ b/includes/modules/pages/page/header_php.php @@ -28,9 +28,10 @@ /* BOF Multilingual EZ Pages 1 of 3 */ $sql = "SELECT e.*, et.* - FROM " . TABLE_EZPAGES . " e, " . TABLE_EZPAGES_TEXT . " et + FROM " . TABLE_EZPAGES . " e, + " . TABLE_EZPAGES_TEXT . " et WHERE e.pages_id = " . (int)$ezpage_id . " - AND et.languages_id = '" . (int)$_SESSION['languages_id'] . "' + AND et.languages_id = " . (int)$_SESSION['languages_id'] . " AND e.pages_id = et.pages_id"; // comment the following line to allow access to pages which don't have a status switch set to Yes: $sql .= " AND (e.status_toc > 0 OR e.status_header > 0 OR e.status_sidebox > 0 OR e.status_footer > 0)"; @@ -60,7 +61,7 @@ AND e.toc_chapter= :chapterID ) AND e.alt_url_external = '' AND e.alt_url = '' - AND et.languages_id = '" . (int)$_SESSION['languages_id'] . "' + AND et.languages_id = " . (int)$_SESSION['languages_id'] . " AND e.pages_id = et.pages_id ORDER BY e.toc_sort_order, e.pages_title"; /* EOF Multilingual EZ Pages 2 of 3 */ diff --git a/includes/modules/sideboxes/YOUR_TEMPLATE/ezpages.php b/includes/modules/sideboxes/YOUR_TEMPLATE/ezpages.php index 82e76fc..df71363 100644 --- a/includes/modules/sideboxes/YOUR_TEMPLATE/ezpages.php +++ b/includes/modules/sideboxes/YOUR_TEMPLATE/ezpages.php @@ -18,13 +18,14 @@ unset($var_linksList); } /* BOF Multilingual EZ Pages 1 of 1 */ - $page_query = $db->Execute("select e.*, et.* - from " . TABLE_EZPAGES . " e, " . TABLE_EZPAGES_TEXT . " et - where e.pages_id = et.pages_id - and et.languages_id = '" . (int)$_SESSION['languages_id'] . "' - and e.status_sidebox = 1 - and e.sidebox_sort_order > 0 - order by e.sidebox_sort_order, et.pages_title"); + $page_query = $db->Execute("SELECT e.*, et.* + FROM " . TABLE_EZPAGES . " e, + " . TABLE_EZPAGES_TEXT . " et + WHERE e.pages_id = et.pages_id + AND et.languages_id = " . (int)$_SESSION['languages_id'] . " + AND e.status_sidebox = 1 + AND e.sidebox_sort_order > 0 + ORDER BY e.sidebox_sort_order, et.pages_title"); /* EOF Multilingual EZ Pages 1 of 1 */ if ($page_query->RecordCount()>0) {