read()) { if (is_dir(DIR_FS_CATALOG_TEMPLATES . $file) && strtoupper($file) != 'CVS' && $file != 'template_default') { if (file_exists(DIR_FS_CATALOG_TEMPLATES . $file . '/template_info.php')) { require(DIR_FS_CATALOG_TEMPLATES . $file . '/template_info.php'); $template_info[$file] = array('name' => $template_name, 'version' => $template_version, 'author' => $template_author, 'description' => $template_description, 'screenshot' => $template_screenshot); } } } $dir->close(); $action = (isset($_GET['action']) ? $_GET['action'] : ''); if (zen_not_null($action)) { switch ($action) { case 'insert': $check_query = $db->Execute("select * from " . TABLE_TEMPLATE_SELECT . " where template_language = '" . $_POST['lang'] . "'"); if ($check_query->RecordCount() < 1 ) { $db->Execute("insert into " . TABLE_TEMPLATE_SELECT . " (template_dir, template_language) values ('" . $_POST['ln'] . "', '" . $_POST['lang'] . "')"); $_GET['tID'] = $db->Insert_ID(); } $action=""; break; case 'save': $db->Execute("update " . TABLE_TEMPLATE_SELECT . " set template_dir = '" . $_POST['ln'] . "' where template_id = '" . $_GET['tID'] . "'"); break; case 'deleteconfirm': $check_query = $db->Execute("select template_language from " . TABLE_TEMPLATE_SELECT . " where template_id = '" . $_GET['tID'] . "'"); if ( $check_query->fields['template_language'] != 0 ) { $db->Execute("delete from " . TABLE_TEMPLATE_SELECT . " where template_id = '" . $_GET['tID'] . "'"); zen_redirect(zen_href_link(FILENAME_TEMPLATE_SELECT, 'page=' . $_GET['page'])); } $action=""; break; } } ?> > <?php echo TITLE; ?>
'' . TEXT_INFO_HEADING_NEW_TEMPLATE . ''); $contents = array('form' => zen_draw_form('zones', FILENAME_TEMPLATE_SELECT, 'page=' . $_GET['page'] . '&action=insert')); $contents[] = array('text' => TEXT_INFO_INSERT_INTRO); while (list ($key, $value) = each($template_info) ) { $template_array[] = array('id' => $key, 'text' => $value['name']); } $lns = $db->Execute("select name, languages_id from " . TABLE_LANGUAGES); while (!$lns->EOF) { $language_array[] = array('text' => $lns->fields['name'], 'id' => $lns->fields['languages_id']); $lns->MoveNext(); } $contents[] = array('text' => '
' . TEXT_INFO_TEMPLATE_NAME . '
' . zen_draw_pull_down_menu('ln', $template_array)); $contents[] = array('text' => '
' . TEXT_INFO_LANGUAGE_NAME . '
' . zen_draw_pull_down_menu('lang', $language_array, $_POST['lang'])); $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'edit': $heading[] = array('text' => '' . TEXT_INFO_HEADING_EDIT_TEMPLATE . ''); $contents = array('form' => zen_draw_form('templateselect', FILENAME_TEMPLATE_SELECT, 'page=' . $_GET['page'] . '&tID=' . $tInfo->template_id . '&action=save')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); reset($template_info); while (list ($key, $value) = each($template_info) ) { $template_array[] = array('id' => $key, 'text' => $value['name']); } $contents[] = array('text' => '
' . TEXT_INFO_TEMPLATE_NAME . '
' . zen_draw_pull_down_menu('ln', $template_array, $templates->fields['template_dir'])); $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'delete': $heading[] = array('text' => '' . TEXT_INFO_HEADING_DELETE_TEMPLATE . ''); $contents = array('form' => zen_draw_form('zones', FILENAME_TEMPLATE_SELECT, 'page=' . $_GET['page'] . '&tID=' . $tInfo->template_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); $contents[] = array('text' => '
' . $template_info[$tInfo->template_dir]['name'] . ''); $contents[] = array('align' => 'center', 'text' => '
' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: if (isset($tInfo) && is_object($tInfo)) { $heading[] = array('text' => '' . $template_info[$tInfo->template_dir]['name'] . ''); if ($tInfo->template_language == 0) { $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ''); } else { $contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ''); } $contents[] = array('text' => '
' . TEXT_INFO_TEMPLATE_AUTHOR . $template_info[$tInfo->template_dir]['author']); $contents[] = array('text' => '
' . TEXT_INFO_TEMPLATE_VERSION . $template_info[$tInfo->template_dir]['version']); $contents[] = array('text' => '
' . TEXT_INFO_TEMPLATE_DESCRIPTION . '
' . $template_info[$tInfo->template_dir]['description']); $contents[] = array('text' => '
' . TEXT_INFO_TEMPLATE_INSTALLED . '
'); while (list ($key, $value) = each($template_info) ) { $contents[] = array('text' => '' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '  ' . $value['name']); } } break; } if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) { echo ' ' . "\n"; } ?>
Execute($template_query_raw); while (!$templates->EOF) { if ((!isset($_GET['tID']) || (isset($_GET['tID']) && ($_GET['tID'] == $templates->fields['template_id']))) && !isset($tInfo) && (substr($action, 0, 3) != 'new')) { $tInfo = new objectInfo($templates->fields); } if (isset($tInfo) && is_object($tInfo) && ($templates->fields['template_id'] == $tInfo->template_id)) { echo ' ' . "\n"; } else { echo ' ' . "\n"; } if ($templates->fields['template_language'] == 0) { $template_language = "Default(All)"; } else { $ln = $db->Execute("select name from " . TABLE_LANGUAGES . " where languages_id = '" . $templates->fields['template_language'] . "'"); $template_language = $ln->fields['name']; } ?> MoveNext(); } ?>
 
fields['template_dir']]['name']; ?> fields['template_dir']; ?> fields['template_id'] == $tInfo->template_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($template_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_TEMPLATES); ?> display_links($template_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
' . zen_image_button('button_new_language.gif', IMAGE_NEW_TEMPLATE) . ''; ?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '