Changeset 1175 in ExiteCMS


Ignore:
Timestamp:
12/16/07 22:55:37 (4 years ago)
Author:
hverton
Message:

several small fixes

Location:
modules/common/wiki/php-files/modules/wiki
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • modules/common/wiki/php-files/modules/wiki/actions/footer.php

    r1161 r1175  
    1313    if ($this->page) 
    1414    { 
    15         switch ($owner = $this->GetPageOwner()) { 
    16             case "(Public)": 
    17                 print("Public page\n"); 
    18                 break; 
    19             case $this->UserIsOwner(): 
    20                 print("You own this page\n"); 
    21                 break; 
    22             case false; 
    23                 print("Nobody".($this->GetUser() ? " (<a href=\"".$this->href("claim")."\">Take Ownership</a>)\n" : "\n")); 
    24             default: 
    25                 if (iMEMBER) { 
    26                     print("Owner: <a href='".BASEDIR."profile.php?lookup=$owner'>".$owner."</a>\n"); 
    27                 } else { 
    28                     print("Owner: $owner\n"); 
    29                 } 
     15        $owner = $this->GetPageOwner(); 
     16        if ($owner == "(Public)") { 
     17            print("Public page\n"); 
     18        } elseif ($owner == false) { 
     19            print("Nobody".($this->GetUser() ? " (<a href=\"".$this->href("claim")."\">Take Ownership</a>)\n" : "\n")); 
     20        } elseif (iMEMBER && $GLOBALS['userdata']['user_name'] == $owner) { 
     21            print("You own this page\n"); 
     22        } else { 
     23            if (iMEMBER) { 
     24                print("Owner: <a href='".BASEDIR."profile.php?lookup=$owner'>".$owner."</a>\n"); 
     25            } else { 
     26                print("Owner: $owner\n"); 
     27            } 
    3028        } 
    31         if ($this->IsAdmin()) { 
    32             print("| <a href=\"".$this->href("acls")."\">Edit ACLs</a>\n"); 
    33         }    
    3429    } 
    3530 
  • modules/common/wiki/php-files/modules/wiki/handlers/page/acls.php

    r1161 r1175  
    2929if (!defined('SET_NO_OWNER_LABEL')) define('SET_NO_OWNER_LABEL', '(Nobody - Set free)'); 
    3030if (!defined('USERS_LABEL')) define('USERS_LABEL', 'Users:'); 
    31 if (!defined('SELECTED_LABEL')) define('SELECTED_LABEL', 'Selected:'); 
     31if (!defined('SELECTED_LABEL')) define('SELECTED_LABEL', 'Give access to:'); 
    3232if (!defined('GROUPS_LABEL')) define('GROUPS_LABEL', 'Usergroups:'); 
    3333if (!defined('INSTRUCTION_LABEL')) define('INSTRUCTION_LABEL', 'Click on the user or groupname to move it in or out of the selected box'); 
  • modules/common/wiki/php-files/modules/wiki/libs/Wakka.class.php

    r1161 r1175  
    11671167    //returns true if user is listed in configuration list as admin 
    11681168    function IsAdmin() { 
    1169         $adminstring = $this->config["admin_users"]; 
    1170         $adminarray = explode(',' , $adminstring); 
    1171  
    1172         foreach ($adminarray as $admin) { 
    1173             if (trim($admin) == $this->GetUserName()) return true; 
     1169        $admingroup = $this->config["admin_group"]; 
     1170        if ($admingroup{0} == "G") { 
     1171            return checkgroup(substr($admingroup,1)); 
     1172        } else { 
     1173            return (iMEMBER && $admingroup == $GLOBALS['userdata']['user_id']); 
    11741174        } 
    11751175    } 
  • modules/common/wiki/php-files/modules/wiki/module_installer.php

    r1165 r1175  
    166166 
    167167// and add initial record(s) to it 
    168 $mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##wiki_pages (id, tag, time, body, owner, user, latest, note, handler) VALUES (1, 'HomePage', now(), '{{image url=\"images/wikka_logo.jpg\" alt=\"wikka logo\" title=\"Welcome to this Wikka Wiki!\"}}\n\nThis site is running on version ##{{wikkaversion}}## (see WikkaReleaseNotes). \nYou need to double-click on any page or click on the \"Edit page\" link at the bottom to get started. \n\nFor more information, visit the [[Wikka:HomePage WikkaWiki website]]! \n\nUseful pages: FormattingRules, WikkaDocumentation, OrphanedPages, WantedPages, TextSearch.', '##WEBMASTER##', '##WEBMASTER##', 'Y', '', 'page')"); 
     168$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##wiki_pages (id, tag, time, body, owner, user, latest, note, handler) VALUES (1, 'HomePage', now(), '{{image url=\"images/wikka_logo.jpg\" alt=\"wikka logo\" title=\"Welcome to the ExiteCMS implementation of Wikka Wiki!\"}}\n\nThis wiki is based on Wikka Wiki version ##{{wikkaversion}}## (see WikkaReleaseNotes). \nTo edit a page, double-click on it or click on the \"Edit page\" link at the bottom. \n\nFor more information, visit the [[Wikka:HomePage WikkaWiki website]]! \n\nUseful pages: FormattingRules, WikkaDocumentation, OrphanedPages, WantedPages, TextSearch.', '##WEBMASTER##', '##WEBMASTER##', 'Y', '', 'page')"); 
    169169$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##wiki_pages (id, tag, time, body, owner, user, latest, note, handler) VALUES (2, 'RecentChanges', now(), '{{RecentChanges}}{{nocomments}}\n\n\n----\nCategoryWiki', '(Public)', '##WEBMASTER##', 'Y', '', 'page')"); 
    170170$mod_install_cmds[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##wiki_pages (id, tag, time, body, owner, user, latest, note, handler) VALUES (3, 'RecentlyCommented', now(), '{{RecentlyCommented}}{{nocomments}}\n\n\n----\nCategoryWiki', '(Public)', '##WEBMASTER##', 'Y', '', 'page')"); 
  • modules/common/wiki/php-files/modules/wiki/wikka.config.php

    r1161 r1175  
    11<?php 
     2 
    23// default config 
    3  
    44$wakkaConfig = array( 
    55    'mysql_host' => $db_host, 
     
    3434    'external_link_new_window' => 1, 
    3535    'sql_debugging' => '0', 
    36     'admin_users' => '', 
    3736    'admin_email' => $settings['siteemail'], 
    3837    'upload_path' => IMAGES."wiki", 
     
    5251); 
    5352 
    54 // get wiki config variables from the CMSconfig table. They override the default config 
    55 $result = dbquery("SELECT * FROM ".$db_prefix."CMSconfig WHERE cfg_name LIKE 'wiki_%'"); 
    56 while ($data = dbarray($result)) { 
    57     // extract the wakkaConfig key from the cfg_name 
    58     $cfgkey = substr($data['cfg_name'],5); 
    59     // if the wakkaConfig key exists, overwrite the value 
    60     if (isset($wakkaConfig[$cfgkey])) { 
    61         $wakkaConfig[$cfgkey] = $data['cfg_value']; 
     53// get wiki config variables from the CMSconfig settings. They override the default config 
     54foreach($settings as $configkey => $configvalue) { 
     55    if (substr($configkey,0,5) == "wiki_") { 
     56        // extract the wakkaConfig key from the cfg_name 
     57        $cfgkey = substr($configkey,5); 
     58        // add the value to the wakkaconfig array 
     59        $wakkaConfig[$cfgkey] = $configvalue; 
    6260    } 
    6361} 
     
    7068    $wakkaConfig['stylesheet'] = 'css/wikka.css'; 
    7169} 
    72 // if the current user is an admin, add the username to the list of admins 
    73 $wakkaConfig['admin_users'] = checkgroup($wakkaConfig['admin_group']) ? (iMEMBER ? $userdata['user_name'] : "*") : ""; 
    7470?> 
Note: See TracChangeset for help on using the changeset viewer.