]> git.mjollnir.org Git - moodle.git/commitdiff
New field in the groups table to "hidepicture" from being displayed
authormoodler <moodler>
Sun, 15 Feb 2004 07:29:55 +0000 (07:29 +0000)
committermoodler <moodler>
Sun, 15 Feb 2004 07:29:55 +0000 (07:29 +0000)
in locations like forums etc.

Backups done too, Eloy.  :-)

backup/backuplib.php
backup/restorelib.php
lib/db/mysql.php
lib/db/mysql.sql
lib/db/postgres7.php
lib/db/postgres7.sql
lib/weblib.php
version.php

index 6f10741cc15e719695d5f16f86990e3bb5344211..f6793f484a4f525e49138050cd3fe8343f75a403 100644 (file)
                 fwrite ($bf,full_tag("DESCRIPTION",4,false,$group->description));
                 fwrite ($bf,full_tag("LANG",4,false,$group->lang));
                 fwrite ($bf,full_tag("PICTURE",4,false,$group->picture));
+                fwrite ($bf,full_tag("HIDEPICTURE",4,false,$group->hidepicture));
                 fwrite ($bf,full_tag("TIMECREATED",4,false,$group->timecreated));
                 fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$group->timemodified));
                 
index 34d4bfb82ed717b0ef194bda572b8f7c79605379..5b7ffcfed420fa4c19589215159eb7e895babdcc 100644 (file)
                         $gro->description = backup_todb($info['GROUP']['#']['DESCRIPTION']['0']['#']);
                         $gro->lang = backup_todb($info['GROUP']['#']['LANG']['0']['#']);
                         $gro->picture = backup_todb($info['GROUP']['#']['PICTURE']['0']['#']);
+                        $gro->hidepicture = backup_todb($info['GROUP']['#']['HIDEPICTURE']['0']['#']);
                         $gro->timecreated = backup_todb($info['GROUP']['#']['TIMECREATED']['0']['#']);
                         $gro->timemodified = backup_todb($info['GROUP']['#']['TIMEMODIFIED']['0']['#']);
                 
index fcb57940feca27c61ea844000c2602d30b5064a4..93a95253d63a4f044b60b6760131a57c88387b1e 100644 (file)
@@ -684,6 +684,9 @@ function main_upgrade($oldversion=0) {
                               ) TYPE=MyISAM COMMENT='For keeping information about cached data';");
     }
 
+    if ($oldversion < 2004021500) {
+        table_column("groups", "", "hidepicture", "integer", "2", "unsigned", "0", "", "picture");
+    }
 
     return $result;
 
index 18b59d314000420db3cd9d2aaa87f290afb74170..1796177c5357ec773a11990b2d01d37bde8c5645 100644 (file)
@@ -201,6 +201,7 @@ CREATE TABLE `prefix_groups` (
   `description` text NOT NULL,
   `lang` varchar(10) NOT NULL default 'en',
   `picture` int(10) unsigned NOT NULL default '0',
+  `hidepicture` int(2) unsigned NOT NULL default '0',
   `timecreated` int(10) unsigned NOT NULL default '0',
   `timemodified` int(10) unsigned NOT NULL default '0',
   PRIMARY KEY  (`id`),
index 664d69f2ed0f89c8e3107b480b1df498305b28fa..4c7581e00edbef2405e42b2ac1fea75d53f3c093 100644 (file)
@@ -429,6 +429,10 @@ function main_upgrade($oldversion=0) {
         modify_database("", "CREATE INDEX prefix_cache_text_md5key_idx ON prefix_cache_text (md5key);");
     }
 
+    if ($oldversion < 2004021500) {
+        table_column("groups", "", "hidepicture", "integer", "2", "unsigned", "0", "", "picture");
+    }
+
     return $result;
 
 }
index ed00389a85dcf1460e06db48cf2c165c8ac7f15a..5b1c9e7933d4359789490047340edb1e47fe0764 100644 (file)
@@ -106,6 +106,7 @@ CREATE TABLE prefix_groups (
    description text,
    lang varchar(10) NOT NULL default '',
    picture integer NOT NULL default '0',
+   hidepicture integer NOT NULL default '0',
    timecreated integer NOT NULL default '0',
    timemodified integer NOT NULL default '0'
 );
index 08a2880035a2d580ffcdb3f03c9c6b5464a576c8..33fa411b0d28a404d10a35c95eb9c7efa4da8ebe 100644 (file)
@@ -1222,32 +1222,34 @@ function print_user($user, $course) {
 function print_group_picture($group, $courseid, $large=false, $returnstring=false, $link=true) {
     global $CFG;
 
-    $output = '';
+    if ($group->hidepicture) {
+        return '';
+    }
 
-    if ($group->showpicture) {
-        if ($link) {
-            $output = "<a href=\"$CFG->wwwroot/course/groupphp?id=$courseid&amp;group=$group->id\">";
-        }
-        if ($large) {
-            $file = "f1";
-            $size = 100;
+    if ($link) {
+        $output = "<a href=\"$CFG->wwwroot/course/groupphp?id=$courseid&amp;group=$group->id\">";
+    } else {
+        $output = '';
+    }
+    if ($large) {
+        $file = "f1";
+        $size = 100;
+    } else {
+        $file = "f2";
+        $size = 35;
+    }
+    if ($group->picture) {  // Print custom group picture
+        if ($CFG->slasharguments) {        // Use this method if possible for better caching
+            $output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/user/pixgroup.php/$group->id/$file.jpg\"".
+                       " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
         } else {
-            $file = "f2";
-            $size = 35;
-        }
-        if ($group->picture) {  // Print custom group picture
-            if ($CFG->slasharguments) {        // Use this method if possible for better caching
-                $output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/user/pixgroup.php/$group->id/$file.jpg\"".
-                           " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
-            } else {
-                $output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/user/pixgroup.php?file=/$group->id/$file.jpg\"".
-                           " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
-            }
-        }
-        if ($link) {
-            $output .= "</a>";
+            $output .= "<img align=\"absmiddle\" src=\"$CFG->wwwroot/user/pixgroup.php?file=/$group->id/$file.jpg\"".
+                       " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
         }
     }
+    if ($link) {
+        $output .= "</a>";
+    }
 
     if ($returnstring) {
         return $output;
index db13f02535b4d6f4dae7c9f8b5cf8602f1b5f67f..7b8273952b5972d11dc95f97c6155406f46e9b48 100644 (file)
@@ -5,7 +5,7 @@
 // database to determine whether upgrades should
 // be performed (see lib/db/*.php)
 
-$version = 2004021400;   // The current version is a date (YYYYMMDDXX)
+$version = 2004021500;   // The current version is a date (YYYYMMDDXX)
 
 $release = "1.2 development";   // User-friendly version number