Browse Source

header : hide my folders if no flag list

Signed-off-by: bachy <git@g-u-i.net>
bachy 12 years ago
parent
commit
39db0ed16d
1 changed files with 11 additions and 5 deletions
  1. 11 5
      materio_flag.module

+ 11 - 5
materio_flag.module

@@ -215,11 +215,17 @@ function materio_flag_block_view($delta = '') {
           $flag->flaged_content = $flaged_content;
           $flags[$name] = $flag;
         }
-
-        // $block['subject'] = t('My !listname'.'s', array('!listname'=>variable_get('flag_lists_name', 'list')));
-        $block['subject'] = t('My '.variable_get('flag_lists_name', 'list').'s');
-        $block['content'] = theme('materio_flag_mylists_nav_block', array("flags"=>$flags));
-        // $block['content'] = theme('flag_lists_user_page', array('uid' => $user->uid));
+        if($flags){
+          // $block['subject'] = t('My !listname'.'s', array('!listname'=>variable_get('flag_lists_name', 'list')));
+          $block['subject'] = t('My '.variable_get('flag_lists_name', 'list').'s');
+        
+          $block['content'] = theme('materio_flag_mylists_nav_block', array("flags"=>$flags));
+          // $block['content'] = theme('flag_lists_user_page', array('uid' => $user->uid));
+        }
+        # what happend if no flags yet
+        // else{
+        //   $block['content'] = t('No !listname yet. Add !listname on clicking on results star', array('!listname'=>variable_get('flag_lists_name', 'list')));
+        // }
       }
       break;
   }