[svn r17355] minor - logic changes - Fixed Hide the link add a forum if there are no categories see FS#3369 (by cvargas)

skala
Cristian Fasanando 17 years ago
parent 1a7c05920e
commit 3720cde913
  1. 28
      main/forum/forumfunction.inc.php
  2. 2
      main/forum/index.php

@ -618,24 +618,28 @@ function delete_forum_forumcategory_thread($content, $id) {
$tool_constant=TOOL_FORUM_CATEGORY;
$return_message=get_lang('ForumCategoryDeleted');
$sql="SELECT forum_id FROM ". $table_forums . "WHERE forum_category='".$id."'";
$result = api_sql_query($sql, __FILE__, __LINE__);
$row = Database::fetch_array($result);
foreach ($row as $arr_forum) {
$forum_id = $arr_forum['forum_id'];
api_item_property_update($_course,'forum',$forum_id,'delete',api_get_user_id());
if (!empty($forum_list)){
$sql="SELECT forum_id FROM ". $table_forums . "WHERE forum_category='".$id."'";
$result = api_sql_query($sql, __FILE__, __LINE__);
$row = Database::fetch_array($result);
foreach ($row as $arr_forum) {
$forum_id = $arr_forum['forum_id'];
api_item_property_update($_course,'forum',$forum_id,'delete',api_get_user_id());
}
}
}
if ($content=='forum') {
$tool_constant=TOOL_FORUM;
$return_message=get_lang('ForumDeleted');
$sql="SELECT thread_id FROM". $table_forum_thread . "WHERE forum_id='".$id."'";
$result = api_sql_query($sql, __FILE__, __LINE__);
$row = mysql_fetch_array($result);
foreach ($row as $arr_forum) {
$forum_id = $arr_forum['thread_id'];
api_item_property_update($_course,'forum_thread',$forum_id,'delete',api_get_user_id());
if (!empty($number_threads)){
$sql="SELECT thread_id FROM". $table_forum_thread . "WHERE forum_id='".$id."'";
$result = api_sql_query($sql, __FILE__, __LINE__);
$row = mysql_fetch_array($result);
foreach ($row as $arr_forum) {
$forum_id = $arr_forum['thread_id'];
api_item_property_update($_course,'forum_thread',$forum_id,'delete',api_get_user_id());
}
}
}
if ($content=='thread') {

@ -191,7 +191,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
echo '<span style="float:right;">'.search_link().'</span>';
if (api_is_allowed_to_edit(false,true)) {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&amp;content=forumcategory"> '.Display::return_icon('forum_category_new.gif', get_lang('AddForumCategory')).' '.get_lang('AddForumCategory').'</a>';
if (is_array($forum_categories_list)) {
if (is_array($forum_categories_list) and !empty($forum_categories_list)) {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&amp;content=forum"> '.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').'</a>';
}
//echo ' | <a href="forum_migration.php">'.get_lang('MigrateForum').'</a>';

Loading…
Cancel
Save