|
|
|
Execute($media_query_raw);
while (!$media->EOF) {
if ((!isset($_GET['mID']) || (isset($_GET['mID']) && ($_GET['mID'] == $media->fields['media_id']))) && !isset($mInfo) && (substr($action, 0, 3) != 'new')) {
$mInfo = new objectInfo($media->fields);
}
if (isset($mInfo) && is_object($mInfo) && ($media->fields['media_id'] == $mInfo->media_id)) {
echo ' ' . "\n";
} else {
echo ' ' . "\n";
}
?>
fields['media_name']; ?> |
fields['media_id'] . '&action=edit') . '">' . zen_image(DIR_WS_IMAGES . 'icon_edit.gif', ICON_EDIT) . ''; ?>
fields['media_id'] . '&action=delete') . '">' . zen_image(DIR_WS_IMAGES . 'icon_delete.gif', ICON_DELETE) . ''; ?>
fields['media_id'] == $mInfo->media_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?>
|
MoveNext();
}
?>
display_count($media_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_MEDIA); ?> |
display_links($media_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?> |
|
media_id . '&action=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . ''; ?> |
|
'' . TEXT_HEADING_NEW_MEDIA_COLLECTION . '');
$contents = array('form' => zen_draw_form('collections', FILENAME_MEDIA_MANAGER, 'action=insert&page=' . $_GET['page'], 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_NEW_INTRO);
$contents[] = array('text' => ' ' . TEXT_MEDIA_COLLECTION_NAME . ' ' . zen_draw_input_field('media_name', '', zen_set_field_length(TABLE_MEDIA_MANAGER, 'media_name')));
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'edit':
$heading[] = array('text' => '' . TEXT_HEADING_EDIT_MEDIA_COLLECTION . '');
$contents = array('form' => zen_draw_form('collections', FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=save', 'post', 'enctype="multipart/form-data"'));
$contents[] = array('text' => TEXT_EDIT_INTRO);
$contents[] = array('text' => ' ' . TEXT_MEDIA_COLLECTION_NAME . ' ' . zen_draw_input_field('media_name', $mInfo->media_name, zen_set_field_length(TABLE_MEDIA_MANAGER, 'media_name')));
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_save.gif', IMAGE_SAVE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
$contents[] = array('text' => zen_draw_separator('pixel_black.gif'));
$contents[] = array('text' => TEXT_MEDIA_EDIT_INSTRUCTIONS);
$contents[] = array('text' => zen_draw_separator('pixel_black.gif'));
$dir = @dir(DIR_FS_CATALOG_MEDIA);
$dir_info[] = array('id' => '', 'text' => "Main Directory");
while ($file = $dir->read()) {
if (@is_dir(DIR_FS_CATALOG_MEDIA . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
$dir_info[] = array('id' => $file . '/', 'text' => $file);
}
}
$dir->close();
$contents[] = array('text' => ' ' . TEXT_ADD_MEDIA_CLIP . zen_draw_file_field('clip_filename'));
$contents[] = array('text' => TEXT_MEDIA_CLIP_DIR . ' ' . zen_draw_pull_down_menu('media_dir', $dir_info));
$media_type_query = "select type_id, type_name, type_ext from " . TABLE_MEDIA_TYPES;
$media_types = $db->Execute($media_type_query);
while (!$media_types->EOF) {
$media_types_array[] = array('id' => $media_types->fields['type_id'], 'text' => $media_types->fields['type_name'] . ' (' . $media_types->fields['type_ext'] . ')');
$media_types->MoveNext();
}
$contents[] = array('text' => TEXT_MEDIA_CLIP_TYPE . ' ' . zen_draw_pull_down_menu('media_type', $media_types_array));
$contents[] = array('text' => '');
$clip_query = "select * from " . TABLE_MEDIA_CLIPS . " where media_id = '" . $mInfo->media_id . "'";
$clips = $db->Execute($clip_query);
while (!$clips->EOF) {
$contents[] = array('text' => '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ' ' . $clips->fields['clip_filename'] . ' ');
$clips->MoveNext();
}
break;
case 'delete':
$heading[] = array('text' => '' . TEXT_HEADING_DELETE_MEDIA_COLLECTION . '');
$contents = array('form' => zen_draw_form('collections', FILENAME_MEDIA_MANAGER, 'page=' . $_GET['page'] . '&mID=' . $mInfo->media_id . '&action=deleteconfirm'));
$contents[] = array('text' => TEXT_DELETE_INTRO);
$contents[] = array('text' => ' ' . $mInfo->media_name . '');
if ($mInfo->products_count > 0) {
$contents[] = array('text' => ' ' . zen_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS);
$contents[] = array('text' => ' ' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count));
}
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
case 'products':
$new_product_query = $db->Execute("select ptc.*, pd.products_name from " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on ptc.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' where ptc.categories_id='" . $current_category_id . "' order by pd.products_name");
$heading[] = array('text' => '' . TEXT_HEADING_ASSIGN_MEDIA_COLLECTION . '');
$contents[] = array('text' => TEXT_PRODUCTS_INTRO . '
');
$contents[] = array('text' => zen_draw_form('new_category', FILENAME_MEDIA_MANAGER, '', 'get') . ' ' .
zen_draw_pull_down_menu('current_category_id', zen_get_category_tree('', '', '0'), '', 'onChange="this.form.submit();"') . zen_hide_session_id() . zen_draw_hidden_field('products_filter', $_GET['products_filter']) . zen_draw_hidden_field('action', 'new_cat') . zen_draw_hidden_field('mID', $mInfo->media_id) . zen_draw_hidden_field('page', $_GET['page']) . ' ');
$product_array = $zc_products->get_products_in_category($current_category_id, false);
if ($product_array) {
$contents[] = array('text' => zen_draw_form('new_product', FILENAME_MEDIA_MANAGER, '', 'get') . ' ' .
zen_draw_pull_down_menu('current_product_id', $product_array) . ' ' . '' .
zen_draw_hidden_field('current_category_id', $current_category_id) .
zen_draw_hidden_field('action', 'add_product') .
zen_draw_hidden_field('page', $_GET['page']) .
zen_draw_hidden_field('mID', $mInfo->media_id) . ' ');
} else {
$contents[] = array('text' => ' ' . TEXT_NO_PRODUCTS);
}
$products_linked_query = "select * from " . TABLE_MEDIA_TO_PRODUCTS . "
where media_id = '" . $mInfo->media_id . "'";
$products_linked = $db->Execute($products_linked_query);
while (!$products_linked->EOF) {
$contents[] = array('text' => '' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ' ' . $zc_products->products_name($products_linked->fields['product_id']) . ' ');
$products_linked->MoveNext();
}
$contents[] = array('align' => 'center', 'text' => ' ' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '');
break;
default:
if (isset($mInfo) && is_object($mInfo)) {
$heading[] = array('text' => '' . $mInfo->media_name . '');
$contents[] = array('align' => 'center', 'text' => '' . zen_image_button('button_edit.gif', IMAGE_EDIT) . ' ' . zen_image_button('button_delete.gif', IMAGE_DELETE) . ' ' . '' . zen_image_button('button_assign_to_product.gif', IMAGE_PRODUCTS) . '');
$contents[] = array('text' => ' ' . TEXT_DATE_ADDED . ' ' . zen_date_short($mInfo->date_added));
if (zen_not_null($mInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . zen_date_short($mInfo->last_modified));
$products_linked_query = "select product_id from " . TABLE_MEDIA_TO_PRODUCTS . "
where media_id = '" . $mInfo->media_id . "'";
$products_linked = $db->Execute($products_linked_query);
$contents[] = array('text' => ' ' . TEXT_PRODUCTS . ' ' . $products_linked->RecordCount());
$clip_query = "select clip_id from " . TABLE_MEDIA_CLIPS . " where media_id = '" . $mInfo->media_id . "'";
$clips = $db->Execute($clip_query);
$contents[] = array('text' => TEXT_CLIPS . ' ' . $clips->RecordCount());
}
break;
}
if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
echo ' ' . "\n";
$box = new box;
echo $box->infoBox($heading, $contents);
echo ' | ' . "\n";
}
?>
|
|