Jump to content
xt:Commerce Community Forum

Reihenfolge ?ndern ?


thetaste

Recommended Posts

Originally posted by sazetueb@Feb 3 2005, 15:34 PM

/templates/index.html

Dort einfach die in deiner gew?nschten Reihenfolge anordnen....

vielen dank. aber hier kann ich doch nur die reihenfolge der boxen an sich ?ndern. richtig ?

ich m?chte die reihenfolge der links IN den boxen ?ndern.

wie mach ich das ?

(danke trotzdem)

Link to comment
Share on other sites

Originally posted by sazetueb@Feb 4 2005, 07:47 AM

Versuche mal im ADMIN-Bereich im Content-Manager anhand der "Gruppe" die Eintr?ge zu sortieren. (0= 1. Stelle, 1= 2. STelle etc.) Merke dir aber vorsichtshalber, welcher EIntrag welche Gruppennummer hat, da ich mir nicht sicher bin, ob dies mit dem Aufruf zu tun hat.

das habe ich schon probiert, es ?ndert tats?chlich irgendwie die reihenfolge, aber l?sst sich nicht wirklich steuern, ich habe das prinzip, das dahintersteckt, nicht wirklich durchschaut. wenn ich ne gruppe ?ndere, kann es sein, dass der link an einer anderen stelle auf einmal platziert ist, aber die reihenfolge der gruppen hat nicht wirklich etwas mit der reihenfolge der links zu tun :grml:

das muss doch irgendwie machbar sein, oder ?

Link to comment
Share on other sites

aber die reihenfolge der gruppen hat nicht wirklich etwas mit der reihenfolge der links zu tun

doch, hat sie :pst:

Fang einfach mal bei der Gruppierung mit einer h?heren Zahl an, z. B. 50, 60, 70 ...

Diese rutschen dann automatisch hinter die vom Shop automatisch erzeugten (die sind von 1 an nummeriert).

Link to comment
Share on other sites

  • 3 weeks later...

Originally posted by chpohl@Feb 7 2005, 22:59 PM

Fang einfach mal bei der Gruppierung mit einer h?heren Zahl an, z. B. 50, 60, 70 ...

Diese rutschen dann automatisch hinter die vom Shop automatisch erzeugten (die sind von 1 an nummeriert).

bin leider erst jetzt dazu gekommen, das auszuprobieren...

aber es tut sich leider ?berhaupt nichts...

hab bei 40 angefangen, in 10er-schritten weitergemacht, aber die reihenfolge der links ist gleichgeblieben :(

(hab ?brigens hier die links in meiner informations-box ?ndern wollen...)

nichtmal die reihenfolge nach den aufsteigenden 10er zahlen ?ndert sich gem?ss der zahl.

und auch die frage von bbaum interessiert mich - die reihenfolge eines systemlinks zu ?ndern (z.b. kontakt, agbs, etc...)

:grml:

Link to comment
Share on other sites

  • 1 year later...

Hi,

damit man den Content sortieren kann sind ein paar kleine ?nderungen in der content_manager.php notwendig.

Zus?tzlich muss in der DB content_manager ein Feld content_sort angef?gt werden. Dann nur noch in der entsprechenden Box, wo der Content sortiert angezeigt werden soll, die "content_query" nur noch um: "order by content_sort" erweitern. das sollte es gewesen sein. Ich nutze ?brigens die XT-Commerce Version - XT-C v1.0 Beta2 Version.

Hier der content_manager.php Code

<?php

/* --------------------------------------------------------------

$Id: content_manager.php,v 1.18 2004/04/21 17:53:43 fanta2k Exp $

XT-Commerce - community made shopping

http://www.xt-commerce.com

Copyright (c) 2003 XT-Commerce

--------------------------------------------------------------

based on:

(c) 2000-2001 The Exchange Project (earlier name of osCommerce)

(c) 2002-2003 osCommercecoding standards www.oscommerce.com

(c) 2003 nextcommerce (content_manager.php,v 1.18 2003/08/25); www.nextcommerce.org

Released under the GNU General Public License

--------------------------------------------------------------

Third Party contribution:

SPAW PHP WYSIWYG editor Copyright: Solmetra (c)2003 All rights reserved. | www.solmetra.com

Released under the GNU General Public License

--------------------------------------------------------------*/

require('includes/application_top.php');

require_once(DIR_FS_INC . 'xtc_format_filesize.inc.php');

require_once(DIR_FS_INC . 'xtc_filesize.inc.php');

$languages = xtc_get_languages();

if ($_GET['special']=='delete') {

xtc_db_query("DELETE FROM ".TABLE_CONTENT_MANAGER." where content_id='".(int)$_GET['coID']."'");

xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER));

} // if get special

if ($_GET['special']=='delete_product') {

xtc_db_query("DELETE FROM ".TABLE_PRODUCTS_CONTENT." where content_id='".(int)$_GET['coID']."'");

xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER,'pID='.(int)$_GET['pID']));

} // if get special

if ($_GET['id']=='update' or $_GET['id']=='insert') {

$content_title=xtc_db_prepare_input($_POST['cont_title']);

$content_header=xtc_db_prepare_input($_POST['cont_heading']);

$content_text=xtc_db_prepare_input($_POST['cont']);

$coID=xtc_db_prepare_input($_POST['coID']);

$upload_file=xtc_db_prepare_input($_POST['file_upload']);

$content_status=xtc_db_prepare_input($_POST['status']);

$content_language=xtc_db_prepare_input($_POST['language']);

$select_file=xtc_db_prepare_input($_POST['select_file']);

$file_flag=xtc_db_prepare_input($_POST['file_flag']);

$parent_check=xtc_db_prepare_input($_POST['parent_check']);

$parent_id=xtc_db_prepare_input($_POST['parent']);

$group_id=xtc_db_prepare_input($_POST['content_group']);

$content_sort=xtc_db_prepare_input($_POST['cont_sort']);

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

if ($languages[$i]['code']==$content_language) $content_language=$languages[$i]['id'];

} // for

$error=false; // reset error flag

if (strlen($content_title) < 1) {

$error = true;

$messageStack->add(ERROR_TITLE,'error');

} // if

if ($content_status=='yes'){

$content_status=1;

} else{

$content_status=0;

} // if

if ($parent_check=='yes'){

$parent_id=$parent_id;

} else{

$parent_id='0';

} // if

if ($error == false) {

// file upload

if ($select_file!='default') $content_file_name=$select_file;

if ($content_file = new upload('file_upload', DIR_FS_CATALOG.'media/content/')) {

$content_file_name=$content_file->filename;

} // if

// update data in table

$sql_data_array = array(

'languages_id' => $content_language,

'content_title' => $content_title,

'content_heading' => $content_header,

'content_text' => $content_text,

'content_file' => $content_file_name,

'content_status' => $content_status,

'parent_id' => $parent_id,

'content_group' => $group_id,

'content_sort' => $content_sort,

'file_flag' => $file_flag);

if ($_GET['id']=='update') {

xtc_db_perform(TABLE_CONTENT_MANAGER, $sql_data_array, 'update', "content_id = '" . $coID . "'");

} else {

xtc_db_perform(TABLE_CONTENT_MANAGER, $sql_data_array);

} // if get id

xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER));

} // if error

} // if

if ($_GET['id']=='update_product' or $_GET['id']=='insert_product') {

$content_title=xtc_db_prepare_input($_POST['cont_title']);

$content_link=xtc_db_prepare_input($_POST['cont_link']);

$content_language=xtc_db_prepare_input($_POST['language']);

$product=xtc_db_prepare_input($_POST['product']);

$upload_file=xtc_db_prepare_input($_POST['file_upload']);

$filename=xtc_db_prepare_input($_POST['file_name']);

$coID=xtc_db_prepare_input($_POST['coID']);

$file_comment=xtc_db_prepare_input($_POST['file_comment']);

$select_file=xtc_db_prepare_input($_POST['select_file']);

$content_sort=xtc_db_prepare_input($_POST['cont_sort']);

$error=false; // reset error flag

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

if ($languages[$i]['code']==$content_language) $content_language=$languages[$i]['id'];

} // for

if (strlen($content_title) < 1) {

$error = true;

$messageStack->add(ERROR_TITLE,'error');

} // if

if ($error == false) {

/* mkdir() wont work with php in safe_mode

if (!is_dir(DIR_FS_CATALOG.'media/products/'.$product.'/')) {

$old_umask = umask(0);

xtc_mkdirs(DIR_FS_CATALOG.'media/products/'.$product.'/',0777);

umask($old_umask);

}

*/

if ($select_file=='default') {

if ($content_file = new upload('file_upload', DIR_FS_CATALOG.'media/products/')) {

$content_file_name=$content_file->filename;

$old_filename=$content_file->filename;

$timestamp=str_replace('.','',microtime());

$timestamp=str_replace(' ','',$timestamp);

$content_file_name=$timestamp.strstr($content_file_name,'.');

$rename_string=DIR_FS_CATALOG.'media/products/'.$content_file_name;

rename(DIR_FS_CATALOG.'media/products/'.$old_filename,$rename_string);

copy($rename_string,DIR_FS_CATALOG.'media/products/backup/'.$content_file_name);

}

if ($content_file_name=='') $content_file_name=$filename;

} else {

$content_file_name=$select_file;

}

// if

// update data in table

$sql_data_array = array(

'products_id' => $product,

'content_name' => $content_title,

'content_file' => $content_file_name,

'content_link' => $content_link,

'file_comment' => $file_comment,

'content_sort' => $content_sort,

'languages_id' => $content_language);

if ($_GET['id']=='update_product') {

xtc_db_perform(TABLE_PRODUCTS_CONTENT, $sql_data_array, 'update', "content_id = '" . $coID . "'");

$content_id = xtc_db_insert_id();

} else {

xtc_db_perform(TABLE_PRODUCTS_CONTENT, $sql_data_array);

$content_id = xtc_db_insert_id();

} // if get id

// rename filename

xtc_redirect(xtc_href_link(FILENAME_CONTENT_MANAGER,'pID='.$product));

}// if error

}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_SESSION['language_charset']; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<style type="text/css">

<!--

.messageStackError, .messageStackWarning { font-family: Verdana, Arial, sans-serif; font-weight: bold; font-size: 10px; background-color: #; }

-->

</style>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td class="columnLeft2" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="80" rowspan="2"><?php echo xtc_image(DIR_WS_ICONS.'heading_content.gif'); ?></td>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

</tr>

<tr>

<td class="main" valign="top">XTC Tools</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>

<table width="100%" border="0">

<tr>

<td>

<?php

if (!$_GET['action']) {

?>

<div class="pageHeading"><br><?php echo HEADING_CONTENT; ?><br></div>

<div class="main"><?php echo CONTENT_NOTE; ?></div>

<?php

xtc_spaceUsed(DIR_FS_CATALOG.'media/content/');

echo '<div class="main">'.USED_SPACE.xtc_format_filesize($total).'</div>';

?>

<?php

// Display Content

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

$content=array();

$content_query=xtc_db_query("SELECT

content_id,

categories_id,

parent_id,

languages_id,

content_title,

content_heading,

content_text,

file_flag,

content_file,

content_status,

content_group,

content_delete,

content_sort

FROM ".TABLE_CONTENT_MANAGER."

WHERE languages_id='".$languages[$i]['id']."'

AND parent_id='0'");

while ($content_data=xtc_db_fetch_array($content_query)) {

$content[]=array(

'CONTENT_ID' =>$content_data['content_id'] ,

'PARENT_ID' => $content_data['parent_id'],

'LANGUAGES_ID' => $content_data['languages_id'],

'CONTENT_TITLE' => $content_data['content_title'],

'CONTENT_HEADING' => $content_data['content_heading'],

'CONTENT_TEXT' => $content_data['content_text'],

'FILE_FLAG' => $content_data['file_flag'],

'CONTENT_FILE' => $content_data['content_file'],

'CONTENT_DELETE' => $content_data['content_delete'],

'CONTENT_GROUP' => $content_data['content_group'],

'CONTENT_STATUS' => $content_data['content_status'],

'CONTENT_SORT' => $content_data['content_sort']);

} // while content_data

?>

<br>

<div class="main"><?php echo xtc_image(DIR_WS_LANGUAGES.$languages[$i]['directory'].'/admin/images/'.$languages[$i]['image']).''.$languages[$i]['name']; ?></div>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" width="10" ><?php echo TABLE_HEADING_CONTENT_ID; ?></td>

<td class="dataTableHeadingContent" width="10" ></td>

<td class="dataTableHeadingContent" width="30%" align="left"><?php echo TABLE_HEADING_CONTENT_TITLE; ?></td>

<td class="dataTableHeadingContent" width="1%" align="middle"><?php echo TABLE_HEADING_CONTENT_GROUP; ?></td>

<td class="dataTableHeadingContent" width="25%"align="left"><?php echo TABLE_HEADING_CONTENT_FILE; ?></td>

<td class="dataTableHeadingContent" nowrap width="5%" align="left"><?php echo TABLE_HEADING_CONTENT_STATUS; ?></td>

<td class="dataTableHeadingContent" nowrap width="" align="middle"><?php echo TABLE_HEADING_CONTENT_BOX; ?></td>

<td class="dataTableHeadingContent" width="30%" align="middle"><?php echo TABLE_HEADING_CONTENT_ACTION; ?></td>

</tr>

<?php

for ($ii = 0, $nn = sizeof($content); $ii < $nn; $ii++) {

$file_flag_sql = xtc_db_query("SELECT file_flag_name FROM " . TABLE_CM_FILE_FLAGS . " WHERE file_flag=" . $content[$ii]['FILE_FLAG']);

$file_flag_result = xtc_db_fetch_array($file_flag_sql);

echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\'" onmouseout="this.className=\'dataTableRow\'">' . "\n";

if ($content[$ii]['CONTENT_FILE']=='') $content[$ii]['CONTENT_FILE']='database';

?>

<td class="dataTableContent" align="left"><?php echo $content[$ii]['CONTENT_ID']; ?></td>

<td bgcolor="<?php echo substr((6543216554/$content[$ii]['CONTENT_GROUP']),0,6); ?>" class="dataTableContent" align="left"></td>

<td class="dataTableContent" align="left"><?php echo $content[$ii]['CONTENT_TITLE']; ?>

<?php

if ($content[$ii]['CONTENT_DELETE']=='0'){

echo '<font color="ff0000">*</font>';

} ?>

</td>

<td class="dataTableContent" align="middle"><?php echo $content[$ii]['CONTENT_GROUP']; ?></td>

<td class="dataTableContent" align="left"><?php echo $content[$ii]['CONTENT_FILE']; ?></td>

<td class="dataTableContent" align="middle"><?php if ($content[$ii]['CONTENT_STATUS']==0) { echo TEXT_NO; } else { echo TEXT_YES; } ?></td>

<td class="dataTableContent" align="middle"><?php echo $file_flag_result['file_flag_name']; ?></td>

<td class="dataTableContent" align="right">

<a href="">

<?php

if ($content[$ii]['CONTENT_DELETE']=='1'){

?>

<a href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER,'special=delete&coID='.$content[$ii]['CONTENT_ID']); ?>" onClick="return confirm('<?php echo CONFIRM_DELETE; ?>')">

<?php echo xtc_image(DIR_WS_ICONS.'delete.gif','Delete','','','style="cursor:hand" onClick="return confirm(\''.DELETE_ENTRY.'\')"').' '.TEXT_DELETE.'</a>';

} // if content

?>

<a href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER,'action=edit&coID='.$content[$ii]['CONTENT_ID']); ?>">

<?php echo xtc_image(DIR_WS_ICONS.'icon_edit.gif','Edit','','','style="cursor:hand"').' '.TEXT_EDIT.'</a>'; ?>

<a style="cursor:hand" onClick="javascript:window.open('<?php echo xtc_href_link(FILENAME_CONTENT_PREVIEW,'coID='.$content[$ii]['CONTENT_ID']); ?>', 'popup', 'toolbar=0, width=640, height=600')"><?php echo xtc_image(DIR_WS_ICONS.'preview.gif','Preview','','','style="cursor:hand"').''.TEXT_PREVIEW.'</a>'; ?>

</td>

</tr>

<?php

$content_1='';

$content_1_query=xtc_db_query("SELECT

content_id,

categories_id,

parent_id,

languages_id,

content_title,

content_heading,

content_text,

file_flag,

content_file,

content_status,

content_delete,

content_sort

FROM ".TABLE_CONTENT_MANAGER."

WHERE languages_id='".$i."'

AND parent_id='".$content[$ii]['CONTENT_ID']."'");

while ($content_1_data=xtc_db_fetch_array($content_1_query)) {

$content_1[]=array(

'CONTENT_ID' =>$content_1_data['content_id'] ,

'PARENT_ID' => $content_1_data['parent_id'],

'LANGUAGES_ID' => $content_1_data['languages_id'],

'CONTENT_TITLE' => $content_1_data['content_title'],

'CONTENT_HEADING' => $content_1_data['content_heading'],

'CONTENT_TEXT' => $content_1_data['content_text'],

'FILE_FLAG' => $content_1_data['file_flag'],

'CONTENT_FILE' => $content_1_data['content_file'],

'CONTENT_DELETE' => $content_1_data['content_delete'],

'CONTENT_SORT' => $content_1_data['content_sort'],

'CONTENT_STATUS' => $content_1_data['content_status']);

}

for ($a = 0, $x = sizeof($content_1); $a < $x; $a++) {

if ($content_1[$a]!='') {

$file_flag_sql = xtc_db_query("SELECT file_flag_name FROM " . TABLE_CM_FILE_FLAGS . " WHERE file_flag=" . $content_1[$a]['FILE_FLAG']);

$file_flag_result = xtc_db_fetch_array($file_flag_sql);

echo '<tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\'" onmouseout="this.className=\'dataTableRow\'">' . "\n";

if ($content_1[$a]['CONTENT_FILE']=='') $content_1[$a]['CONTENT_FILE']='database';

?>

<td class="dataTableContent" align="left"><?php echo $content_1[$a]['CONTENT_ID']; ?></td>

<td class="dataTableContent" align="left">--<?php echo $content_1[$a]['CONTENT_TITLE']; ?></td>

<td class="dataTableContent" align="left"><?php echo $content_1[$a]['CONTENT_FILE']; ?></td>

<td class="dataTableContent" align="middle"><?php if ($content_1[$a]['CONTENT_STATUS']==0) { echo TEXT_NO; } else { echo TEXT_YES; } ?></td>

<td class="dataTableContent" align="middle"><?php echo $file_flag_result['file_flag_name']; ?></td>

<td class="dataTableContent" align="right">

<a href="">

<?php

if ($content_1[$a]['CONTENT_DELETE']=='1'){

?>

<a href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER,'special=delete&coID='.$content_1[$a]['CONTENT_ID']); ?>" onClick="return confirm('<?php echo CONFIRM_DELETE; ?>')">

<?php echo xtc_image(DIR_WS_ICONS.'delete.gif','Delete','','','style="cursor:hand" onClick="return confirm(\''.DELETE_ENTRY.'\')"').' '.TEXT_DELETE.'</a>';

} // if content

?>

<a href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER,'action=edit&coID='.$content_1[$a]['CONTENT_ID']); ?>">

<?php echo xtc_image(DIR_WS_ICONS.'icon_edit.gif','Edit','','','style="cursor:hand"').' '.TEXT_EDIT.'</a>'; ?>

<a style="cursor:hand" onClick="javascript:window.open('<?php echo xtc_href_link(FILENAME_CONTENT_PREVIEW,'coID='.$content_1[$a]['CONTENT_ID']); ?>', 'popup', 'toolbar=0, width=640, height=600')"

><?php echo xtc_image(DIR_WS_ICONS.'preview.gif','Preview','','','style="cursor:hand"').''.TEXT_PREVIEW.'</a>'; ?>

</td>

</tr>

<?php

}

} // for content

} // for language

?>

</table>

<?php

}

} else {

switch ($_GET['action']) {

// Diplay Editmask

case 'new':

case 'edit':

if ($_GET['action']!='new') {

$content_query=xtc_db_query("SELECT

content_id,

categories_id,

parent_id,

languages_id,

content_title,

content_heading,

content_text,

file_flag,

content_file,

content_status,

content_group,

content_delete,

content_sort

FROM ".TABLE_CONTENT_MANAGER."

WHERE content_id='".(int)$_GET['coID']."'");

$content=xtc_db_fetch_array($content_query);

}

$languages_array = array();

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

if ($languages[$i]['id']==$content['languages_id']) {

$languages_selected=$languages[$i]['code'];

$languages_id=$languages[$i]['id'];

}

$languages_array[] = array('id' => $languages[$i]['code'],

'text' => $languages[$i]['name']);

} // for

if ($languages_id!='') $query_string='languages_id='.$languages_id.' AND';

$categories_query=xtc_db_query("SELECT

content_id,

content_title

FROM ".TABLE_CONTENT_MANAGER."

WHERE ".$query_string." parent_id='0'

AND content_id!='".(int)$_GET['coID']."'");

while ($categories_data=xtc_db_fetch_array($categories_query)) {

$categories_array[]=array(

'id'=>$categories_data['content_id'],

'text'=>$categories_data['content_title']);

}

?>

<br><br>

<?php

if ($_GET['action']!='new') {

echo xtc_draw_form('edit_content',FILENAME_CONTENT_MANAGER,'action=edit&id=update&coID='.$_GET['coID'],'post','enctype="multipart/form-data"').xtc_draw_hidden_field('coID',$_GET['coID']);

} else {

echo xtc_draw_form('edit_content',FILENAME_CONTENT_MANAGER,'action=edit&id=insert&coID='.$_GET['coID'],'post','enctype="multipart/form-data"').xtc_draw_hidden_field('coID',$_GET['coID']);

} ?>

<table class="main" width="100%" border="0">

<tr>

<td width="10%"><?php echo TEXT_LANGUAGE; ?></td>

<td width="90%"><?php echo xtc_draw_pull_down_menu('language',$languages_array,$languages_selected); ?></td>

</tr>

<?php

if ($content['content_delete']!=0 or $_GET['action']=='new') {

?>

<tr>

<td width="10%"><?php echo TEXT_GROUP; ?></td>

<td width="90%"><?php echo xtc_draw_input_field('content_group',$content['content_group'],'size="5"'); ?><?php echo TEXT_GROUP_DESC; ?></td>

</tr>

<?php

} else {

echo xtc_draw_hidden_field('content_group',$content['content_group']);

?>

<tr>

<td width="10%"><?php echo TEXT_GROUP; ?></td>

<td width="90%"><?php echo $content['content_group']; ?></td>

</tr>

<?php

}

$file_flag_sql = xtc_db_query("SELECT file_flag as id, file_flag_name as text FROM " . TABLE_CM_FILE_FLAGS);

while($file_flag = xtc_db_fetch_array($file_flag_sql)) {

$file_flag_array[] = array('id' => $file_flag['id'], 'text' => $file_flag['text']);

}

?>

<tr>

<td width="10%"><?php echo TEXT_FILE_FLAG; ?></td>

<td width="90%"><?php echo xtc_draw_pull_down_menu('file_flag',$file_flag_array,$content['file_flag']); ?></td>

</tr>

<?php

/* build in not completed yet

<tr>

<td width="10%"><?php echo TEXT_PARENT; ?></td>

<td width="90%"><?php echo xtc_draw_pull_down_menu('parent',$categories_array,$content['parent_id']); ?><?php echo xtc_draw_checkbox_field('parent_check', 'yes',false).' '.TEXT_PARENT_DESCRIPTION; ?></td>

</tr>

*/

?>

<tr>

<td valign="top" width="10%"><?php echo TEXT_STATUS; ?></td>

<td width="90%"><?php

if ($content['content_status']=='1') {

echo xtc_draw_checkbox_field('status', 'yes',true).' '.TEXT_STATUS_DESCRIPTION;

} else {

echo xtc_draw_checkbox_field('status', 'yes',false).' '.TEXT_STATUS_DESCRIPTION;

}

?><br><br></td>

</tr>

<tr>

<td width="10%"><?php echo TEXT_TITLE; ?></td>

<td width="90%"><?php echo xtc_draw_input_field('cont_title',$content['content_title'],'size="60"'); ?></td>

</tr>

<tr>

<td width="10%">Sortierung</td>

<td width="90%"><?php echo xtc_draw_input_field('cont_sort',$content['content_sort'],'size="60"'); ?></td>

</tr>

<tr>

<td width="10%"><?php echo TEXT_HEADING; ?></td>

<td width="90%"><?php echo xtc_draw_input_field('cont_heading',$content['content_heading'],'size="60"'); ?></td>

</tr>

<tr>

<td width="10%" valign="top"><?php echo TEXT_UPLOAD_FILE; ?></td>

<td width="90%"><?php echo xtc_draw_file_field('file_upload').' '.TEXT_UPLOAD_FILE_LOCAL; ?></td>

</tr>

<tr>

<td width="10%" valign="top"><?php echo TEXT_CHOOSE_FILE; ?></td>

<td width="90%">

<?php

if ($dir= opendir(DIR_FS_CATALOG.'media/content/')){

while (($file = readdir($dir)) !==false) {

if (is_file( DIR_FS_CATALOG.'media/content/'.$file) and ($file !="index.html")){

$files[]=array(

'id' => $file,

'text' => $file);

}//if

} // while

closedir($dir);

}

// set default value in dropdown!

if ($content['content_file']=='') {

$default_array[]=array('id' => 'default','text' => TEXT_SELECT);

$default_value='default';

$files=array_merge($default_array,$files);

} else {

$default_array[]=array('id' => 'default','text' => TEXT_NO_FILE);

$default_value=$content['content_file'];

$files=array_merge($default_array,$files);

}

echo '<br>'.TEXT_CHOOSE_FILE_SERVER.'</br>';

echo xtc_draw_pull_down_menu('select_file',$files,$default_value);

if ($content['content_file']!='') {

echo TEXT_CURRENT_FILE.' <b>'.$content['content_file'].'</b><br>';

}

?>

</td>

</td>

</tr>

<tr>

<td width="10%" valign="top"></td>

<td colspan="90%" valign="top"><br><?php echo TEXT_FILE_DESCRIPTION; ?></td>

</tr>

<tr>

<td width="10%" valign="top"><?php echo TEXT_CONTENT; ?></td>

<td width="90%">

<?php

if (USE_SPAW=='true') {

$sw = new SPAW_Wysiwyg(

$control_name='cont', // control's name

$value=stripslashes($content['content_text']), // initial value

$lang='', // language

$mode = 'full', // toolbar mode

$theme='default', // theme (skin)

$width='100%', // width

$height='500px', // height

$css_stylesheet='', // css stylesheet file for content

$dropdown_data='' // data for dropdowns (style, font, etc.)

);

$sw->show();

} else {

echo xtc_draw_textarea_field('cont','','100','35',$content['content_text']);

}

?>

</td>

</tr>

<tr>

<td colspan="2" align="right" class="main"><?php echo xtc_image_submit('button_save.gif', IMAGE_SAVE); ?><a href="<?php echo xtc_href_link(FILENAME_CONTENT_MANAGER); ?>"><?php echo xtc_image_button('button_back.gif', IMAGE_BACK); ?></a></td>

</tr>

</table>

</form>

<?php

break;

case 'edit_products_content':

case 'new_products_content':

if ($_GET['action']=='edit_products_content') {

$content_query=xtc_db_query("SELECT

content_id,

products_id,

content_name,

content_file,

content_link,

languages_id,

file_comment,

content_read

FROM ".TABLE_PRODUCTS_CONTENT."

WHERE content_id='".(int)$_GET['coID']."'");

$content=xtc_db_fetch_array($content_query);

}

// get products names.

$products_query=xtc_db_query("SELECT

products_id,

products_name

FROM ".TABLE_PRODUCTS_DESCRIPTION."

WHERE language_id='".(int)$_SESSION['languages_id']."'");

$products_array='';

while ($products_data=xtc_db_fetch_array($products_query)) {

$products_array[]=array(

'id' => $products_data['products_id'],

'text' => $products_data['products_name']);

}

// get languages

$languages_array = array();

for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {

if ($languages[$i]['id']==$content['languages_id']) {

$languages_selected=$languages[$i]['code'];

$languages_id=$languages[$i]['id'];

}

$languages_array[] = array('id' => $languages[$i]['code'],

'text' => $languages[$i]['name']);

} // for

// get used content files

$content_files_query=xtc_db_query("SELECT DISTINCT

content_name,

content_file

FROM ".TABLE_PRODUCTS_CONTENT."

WHERE content_file!=''");

$content_files='';

while ($content_files_data=xtc_db_fetch_array($content_files_query)) {

$content_files[]=array(

'id' => $content_files_data['content_file'],

'text' => $content_files_data['content_name']);

}

// add default value to array

$default_array[]=array('id' => 'default','text' => TEXT_SELECT);

$default_value='default';

$content_files=array_merge($default_array,$content_files);

// mask for product content

if ($_GET['action']!='new_products_content') {

?>

<?php echo xtc_draw_form('edit_content',FILENAME_CONTENT_MANAGER,'action=edit_products_content&id=update_product&coID='.$_GET['coID'],'post','enctype="multipart/form-data"').xtc_draw_hidden_field('coID',$_GET['coID']); ?>

<?php

} else {

?>

<?php echo xtc_draw_form('edit_content',FILENAME_CONTENT_MANAGER,'action=edit_products_content&id=insert_product','post','enctype="multipart/form-data"'); ?>

<?php

}

?>

<div class="main"><?php echo TEXT_CONTENT_DESCRIPTION; ?></div>

<table class="main" width="100%" border="0">

<tr>

<td width="10%"><?php echo TEXT_PRODUCT; ?></td>

<td width="90%"><?php echo xtc_draw_pull_down_menu('product',$products_array,$content['products_id']); ?></td>

</tr>

<tr>

<td width="10%"><?php echo TEXT_LANGUAGE; ?></td>

<td width="90%"><?php echo xtc_draw_pull_down_menu('language',$languages_array,$languages_selected); ?></td>

</tr

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...