diff -urp Orig/hidden_content/hidden_content.info New/hidden_content/hidden_content.info
--- Orig/hidden_content/hidden_content.info 2007-04-21 17:08:59.000000000 -0700
+++ New/hidden_content/hidden_content.info 2008-07-04 16:57:03.000000000 -0700
@@ -1,7 +1,4 @@
; $Id: hidden_content.info,v 1.1 2007/02/05 22:22:30 1stangel Exp $
name = Hidden Content
description = "This is a filter module that enables you to make parts of your homepage hidden to users that are not in a special role or user."
-; Information added by drupal.org packaging script on 2007-04-22
-version = "5.x-1.x-dev"
-project = "hidden_content"
-
+core=6.x
\ No newline at end of file
diff -urp Orig/hidden_content/hidden_content.module New/hidden_content/hidden_content.module
--- Orig/hidden_content/hidden_content.module 2007-02-05 14:22:30.000000000 -0800
+++ New/hidden_content/hidden_content.module 2008-07-04 17:27:48.000000000 -0700
@@ -1,112 +1,122 @@
-\n";
- $text .= "You can specify which role is able to see the content by using the attribute role like this:
\n";
- $text .= "[hidden role=5]text[/hidden]. This will enable role 5 to see the text.\n
";
- $text .= "You can specify that only one user is able to see it with the user parameter:
\n";
- $text .= "[hidden user=2]text[/hidden]. This will enable user 2 to see the text.\n
";
- $text .= "You may only specify one parameter.\n
";
- $text .= "You may specify multiple users OR roles as a ';' seperated list.\n
";
- $text .= "[hidden role=2;3]text[/hidden]. This will enable role 2 and 3 to see the text.\n
";
- $text .= "If you ommit both parameters only user 1 will be able to see it.\n
";
- return t($text);
- }else{
- return t("You may insert [hidden]text[/hidden] into your text.");
- }
-}
-
-/**
- * Implementation of hook_filter().
- *
- */
-function hidden_content_filter($op, $delta = 0, $format = -1, $text = ''){
- global $user;
- switch ($op) {
- case 'no cache':
- return true;
-
- case 'list':
- return array(0 => t('hidden content'));
-
- case 'description':
- return t('Provides [hidden] and [/hidden] tags wich create a hidden area in your text that only a specified role or user can see.');
- case 'prepare':
- return $text;
-
- case 'process':
- if(!ereg('\[hidden',$text)){
- return $text;
- }
- $parts=explode('[hidden',$text);
- $new_text=$parts[0];
- for($part_num=1;$part_numroles[$role]!=""){
- $show=true;
- }
- }
- }else if(ereg('^ user=([0-9;]+)\]',$part,$hit)){
- $users=$hit[1];
- $part=ereg_replace('^ user=([0-9;]+)\]','',$part);
- $show=false;
- $users=explode(';',$users);
- foreach($users as $user_id){
- if($user->uid==$user_id){
- $show=true;
- }
- }
- }else if(ereg('^\]',$part,$hit)){
- $part=ereg_replace('^\]','',$part);
- if($user->uid==1){
- $show=true;
- }else{
- $show=false;
- }
- }else{
- $show=false;
- }
-
- $small_parts=explode('[/hidden]',$part);
- $first=array_shift($small_parts);
- if($show){
- $new_text.=$first;
- }
- $new_text.=implode('[/hidden]',$small_parts);
- }
- return $new_text;
- break;
- }
-}
-
-/**
-* Valid permissions for this module
-* @return array An array of valid permissions for the onthisdate module
-*/
-function hidden_content_perm() {
- return array();
+\n";
+ $text .= "You can specify which role is able to see the content by using the attribute role like this:
\n";
+ $text .= "[hidden role=5]text[/hidden]. This will enable role 5 to see the text.\n
";
+ $text .= "You can specify that only one user is able to see it with the user parameter:
\n";
+ $text .= "[hidden user=2]text[/hidden]. This will enable user 2 to see the text.\n
";
+ $text .= "You may only specify one parameter.\n
";
+ $text .= "You may specify multiple users OR roles as a ';' seperated list.\n
";
+ $text .= "[hidden role=2;3]text[/hidden]. This will enable role 2 and 3 to see the text.\n
";
+ $text .= "If you ommit both parameters only user 1 will be able to see it.\n
";
+ return t($text);
+ }
+ else {
+ return t("You may insert [hidden]text[/hidden] into your text.");
+ }
+}
+
+/**
+ * Implementation of hook_filter().
+ *
+ */
+function hidden_content_filter($op, $delta = 0, $format = -1, $text = '') {
+ global $user;
+ switch ($op) {
+ case 'no cache':
+ return true;
+
+ case 'list':
+ return array(0 => t('Hidden content'));
+
+ case 'description':
+ return t('Provides [hidden] and [/hidden] tags wich create a hidden area in your text that only a specified role or user can see.');
+ case 'prepare':
+ return $text;
+
+ case 'process':
+ if (!ereg('\[hidden', $text)) {
+ return $text;
+ }
+ $parts = explode('[hidden', $text);
+ $new_text = $parts[0];
+ for ($part_num = 1; $part_numroles[$role] != "") {
+ $show = true;
+ }
+ }
+ }
+ else if (ereg('^ user=([0-9;]+)\]', $part, $hit)) {
+ $users = $hit[1];
+ $part = ereg_replace('^ user=([0-9;]+)\]', '', $part);
+ $show = false;
+ $users = explode(';', $users);
+ foreach ($users as $user_id) {
+ if ($user->uid == $user_id) {
+ $show = true;
+ }
+ }
+ }
+ else if (ereg('^\]', $part, $hit)) {
+ $part = ereg_replace('^\]', '', $part);
+ if ($user->uid == 1) {
+ $show = true;
+ }
+ else {
+ $show=false;
+ }
+ }
+ else {
+ $show=false;
+ }
+
+ $small_parts = explode('[/hidden]', $part);
+ $first = array_shift($small_parts);
+ if ($show) {
+ $new_text .= $first;
+ }
+ $new_text .= implode('[/hidden]', $small_parts);
+ }
+ return $new_text;
+ break;
+ }
+}
+
+/**
+ * Valid permissions for this module
+ * @return array An array of valid permissions for the onthisdate module
+ */
+function hidden_content_perm() {
+ return array();
} // function onthisdate_perm()
\ No newline at end of file
Only in Orig/hidden_content/: po
Only in New/hidden_content/: translations