Changeset 117

Show
Ignore:
Timestamp:
07/02/07 00:40:16 (1 year ago)
Author:
wikiplugin
Message:

Folio v63, minor enhancements and bug fixes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • folio/folio/config.php

    r115 r117  
    33 
    44global $CFG; 
    5 $FOLIO_CFG->version = 0.62
     5$FOLIO_CFG->version = 0.63
    66$FOLIO_CFG->ajaxprefix = 'folio_control_tree_'; 
    77 
     
    1313$FOLIO_CFG->page_defaultpermission = 'MODERATED'; 
    1414 
    15 // Keep old pages in the rss feed. AKA, if bob makes a change, and then tim, do you only want to see 
     15// Keep old pages in the rss/activity feed. AKA, if bob makes a change, and then tim, do you only want to see 
    1616//      tim's?  If you want both, set to false, else true. 
    1717//      Please note that this doesn't change the page history records, those are always kept.  it's just about 
    1818//      exposing the record changes thru the feed system. 
    19 $FOLIO_CFG->page_deleteoldpagesfromrss = false; 
     19$FOLIO_CFG->page_deleteoldpagesfromrss = true; 
    2020 
    2121 
  • folio/folio/control/feeds.php

    r111 r117  
    8989* 
    9090**/ 
    91 function folio_control_htmlfeed( $items, $itemcount, $page, $username ) { 
     91function folio_control_htmlfeed( $items, $itemcount, $page, $username, $summary ) { 
    9292    global $profile_id; 
    9393    global $page_owner; 
     
    102102    } 
    103103 
    104     // Disabled code, not needed since I don't use the javascript expand property for the results.     
    105     //    If I ever use again, be sure to uncomment the js stuff below belonging to this function. 
    106     //    $keys = '';     
    107     //    array_walk( $results, 'retrieve_rsskeys', &$keys); 
    108     //    build_js(&$keys) .  
    109      
    110104    // Build top of page 
    111     $body = folio_control_htmlfeed_header ($page, ceil( floatval( $itemcount) / $perpage ) ); 
     105    $body = folio_control_htmlfeed_header ($page, ceil( floatval( $itemcount) / $perpage ) ) . 
     106        '<style type="text/css"> 
     107        .folioinfo { margin:10px 0 1px 1px;}</style> 
     108        <div id="view_own_blog">'; 
    112109 
    113110    // Start list numbering (increment $from, as it's zero-based) 
    114     $body .= "<ol start='" . ( $from + 1 ) . "'>"; 
     111    //$body .= "<ol start='" . ( $from + 1 ) . "'>"; 
    115112     
    116113    // Add individual items. (false if empty) 
    117114    if ( $items ) { 
    118         array_walk( $items, 'folio_control_htmlfeed_item', &$body ); 
     115        foreach ( $items as $item ) { 
     116            $body .= folio_control_htmlfeed_item( $item, $summary ); 
     117        } 
    119118    } else { 
    120119        $body = 'No items to show.'; 
    121120    } 
    122121     
    123     $body .= folio_control_htmlfeed_header ($page, ceil( floatval( $itemcount) / $perpage ) ) 
    124             . '</table></ol>'; 
     122    $body .= folio_control_htmlfeed_header ($page, ceil( floatval( $itemcount) / $perpage ) ) . 
     123            '</div>';  
    125124         
    126125    return $body; 
     
    129128 
    130129// Format results 
    131 function folio_control_htmlfeed_item( $result, $key, &$html ) { 
     130function folio_control_htmlfeed_item( $record, $summary ) { 
    132131    global $CFG; 
    133  
    134     $date = gmdate("D M d",intval($result->created)); 
    135     $type = str_replace( '_', ' ', $result->type ); 
    136     $iconid = user_info("icon", $result->user_ident); 
    137  
     132    $html = ''; 
     133    $date = gmdate("D M d",intval($record->created)); 
     134    $type = str_replace( '_', ' ', $record->type ); 
     135    $body = ( $summary ? strip_tags( substr( $record->body, 0, 250 ) ) : $record->body ); 
     136    $iconid = intval( user_info("icon", $record->user_ident) == -1 ? 0 : user_info("icon", $record->user_ident)) ; 
     137         
    138138    $html .= <<< END 
    139         <tr> 
    140             <td width="70" valign="top"> 
    141                 <a href="{$CFG->wwwroot}{$result->user_username}"> 
    142                     <img alt="" src="{$CFG->wwwroot}_icon/user/{$iconid}/h/50/w/50" border="0"/> 
    143                 </a> 
    144             </td> 
    145             <td valign='top'> 
    146                 <b><a href="{$result->link}">{$result->title}</a></b><br/> 
    147                 <a href='{$CFG->wwwroot}{$result->owner_username}'>{$result->owner_username}</a> | $type | $date<br/> 
    148                 $result->body <i></i> 
    149             </td> 
    150         </tr> 
     139<div class="weblog-post"> 
     140    <div class="user"> 
     141        <a href="{$CFG->wwwroot}{$record->user_username}"> 
     142            <img alt="" src="{$CFG->wwwroot}_icon/user/{$iconid}"/> 
     143        </a> 
     144    </div> 
     145    <div class="weblog-title"> 
     146        <h3><a href="{$record->link}">{$record->title}</a></h3> 
     147    </div> 
     148    <div class="folioinfo"> 
     149        <a href="{$CFG->wwwroot}{$record->owner_username}">{$record->owner_username}</a> | $type | $date<br/> 
     150    </div> 
     151    <div class="post"> 
     152        {$body} 
     153        <br/> 
     154        <h3><a href="{$record->link}">[More]</a></h3> 
     155    </div> 
     156</div> 
     157<div class="clearing"></div>  
    151158END; 
    152  
    153  
    154         // Saved javascript expand/collaspe code:  
    155         //    javascript: switchMenu('rssitem_{$key}'); 
    156     } 
     159    return $html; 
     160
    157161 
    158162// Build pagination control for top of page. 
    159163function folio_control_htmlfeed_header ($page, $pages ) { 
    160164        // Don't build header if there's only a single page. 
    161         if ($pages == 1) { return '<table><br/>'; } 
     165        if ($pages == 1) { return '<br/>'; } 
    162166         
    163167        $result = "<table border = 0 width=100% ><tr><td width=35% align=right>"; 
     
    173177        } 
    174178         
    175         return $result . "</td></tr></table><table>" ; 
     179        return $result . "</td></tr></table>" ; // Removed <table> as turned table into divs 
    176180    }     
    177  
    178 /////////////////////////////////////////////////////////////////////////////////////////// 
    179 //  Shorter version of the HTML View Type 
    180 /////////////////////////////////////////////////////////////////////////////////////////// 
    181  
    182  
    183 /** 
    184 * Return a summary view for the passed items. 
    185 * 
    186 **/ 
    187 function folio_control_summaryfeed( $items, $itemcount, $page, $username ) { 
    188     global $profile_id; 
    189     global $page_owner; 
    190      
    191     $perpage = 10; 
    192      
    193     // Build $from variable 
    194     $from = ($page-1) * $perpage; 
    195     if ( $from > $itemcount ) {  
    196         error('Invalid page number ' . $page . ' passed to function folio_control_summaryfeed'); 
    197         die(); 
    198     } 
    199      
    200     // Build top of page 
    201     $body = folio_control_htmlfeed_header ($page, ceil( floatval( $itemcount) / $perpage ) ); 
    202  
    203     // Start list numbering (increment $from, as it's zero-based) 
    204     $body .= "<ol start='" . ( $from + 1 ) . "'>"; 
    205      
    206     // Add individual items. (false if empty) 
    207     if ( $items ) { 
    208         array_walk( $items, 'folio_control_summaryfeed_item', &$body ); 
    209     } else { 
    210         $body = 'No items to show.'; 
    211     } 
    212      
    213     $body .= folio_control_htmlfeed_header ($page, ceil( floatval( $itemcount) / $perpage ) ) 
    214             . '</table></ol>'; 
    215          
    216     return $body; 
    217  
    218 } 
    219  
    220  
    221 // Format results 
    222 function folio_control_summaryfeed_item( $result, $key, &$html ) { 
    223     global $_SESSION; 
    224     global $CFG; 
    225  
    226     $url = url; 
    227     $icon = run("icons:get", $result->user_ident); 
    228     $teaser = strip_tags( substr( $result->body, 0, 150 ) ); 
    229     $date = gmdate("D M d",intval($result->created)); 
    230     $type = str_replace( 'weblog', 'blog', str_replace( 'page', 'wiki page', str_replace( '_', ' ', $result->type ))); 
    231  
    232  
    233     // src="{$url}{$result->user_username}/icons/{$icon}/h/67/w/67"  
    234     $iconurl = $CFG->wwwroot . "_icon/user/" . user_info("icon",$result->user_ident) . '/h/50/w/50'; 
    235  
    236     /* 
    237     if ( $result->user_username == '-1' ) { 
    238         $iconurl = "{$url}_icon/user/-1/h/50/w/50"; 
    239     }  else { 
    240         $iconurl = "{$url}_icon/user/{$result->user_ident}/h/50/w/50"; 
    241     } */ 
    242     $html .= <<< END 
    243         <tr> 
    244             <td width="70" valign="top"> 
    245                 <a href='{$url}{$result->user_username}'> 
    246                     <img alt="" src="{$iconurl}" border="0"/> 
    247                 </a> 
    248             </td> 
    249             <td valign='top'> 
    250                 <b><a href='{$result->link}'>{$result->title}</a></b><br/> 
    251                 <a href='{$url}{$result->owner_username}'>{$result->owner_username}</a> | $type | $date<br/> 
    252                 $teaser <b><a href='{$result->link}'> [link]</a></b> 
    253             </td> 
    254         </tr> 
    255 END; 
    256  
    257  
    258         // Saved javascript expand/collaspe code:  
    259         //    javascript: switchMenu('rssitem_{$key}'); 
    260     } 
    261  
    262      
    263 /////////////////////////////////////////////////////////////////////////////////////////// 
    264 //  UNUSED JAVASCRIPT 
    265 /////////////////////////////////////////////////////////////////////////////////////////// 
    266  
    267      
    268     /* 
    269 * Commented out, as folio_control_htmlfeed was modified to not have the  
    270 *    individual entries commented out.  Save for reference. 
    271  
    272     function build_js( $keys ) { 
    273  
    274         return <<< END 
    275         <script type="text/javascript"> 
    276             // Expand & Collaspe JS Code 
    277             // Original version posted online at: 
    278             // http://www.dustindiaz.com/dhtml-expand-and-collapse-div-menu/ 
    279         <!-- 
    280             function switchMenu(obj) { 
    281                 var el = document.getElementById(obj); 
    282                 if ( el.style.display != 'none' ) { 
    283                     el.style.display = 'none'; 
    284                 } else { 
    285                     el.style.display = ''; 
    286                 } 
    287             } 
    288  
    289             function $() { 
    290                 var elements = new Array(); 
    291                 for (var i = 0; i < arguments.length; i++) { 
    292                     var element = arguments[i]; 
    293                     if (typeof element == 'string') 
    294                         element = document.getElementById(element); 
    295                     if (arguments.length == 1) 
    296                         return element; 
    297                     elements.push(element); 
    298                 } 
    299                 return elements; 
    300             } 
    301  
    302             function displayElements(objs, displaystyle) { 
    303                 var i; 
    304                 for (i=0;i<objs.length;i++ ) { 
    305                     objs[i].style.display = displaystyle; 
    306                 } 
    307             } 
    308              
    309             function openItems() { 
    310                 displayElements($({$keys}), ''); 
    311             } 
    312             function closeItems() { 
    313                 displayElements($({$keys}), 'none'); 
    314             } 
    315  
    316             addEvent(window,'load',pageLoad); 
    317         --> 
    318         </script>     
    319 END; 
    320  
    321     } 
    322  
    323  
    324     // Format results 
    325     function retrieve_rsskeys( $result, $key, &$html ) { 
    326         if ( strlen($html) > 0 ) { 
    327             $html .= ",'rssitem_{$key}' "; 
    328         } else { 
    329             $html .= "'rssitem_{$key}'"; 
    330         } 
    331  
    332     }     
    333 */ 
    334  
    335181 
    336182/////////////////////////////////////////////////////////////////////////////////////////// 
  • folio/folio/control/page_edit.php

    r115 r117  
    3131    global $page_owner; 
    3232        global $metatags; 
     33    $user = get_record('users','username',$username); 
     34    $url = url; 
    3335     
    34          
    3536    if (!$page && !isloggedin() ) { 
    3637                // We don't allow non-logged in users to create new pages 
     
    5455 
    5556                // Translate passed username into a user ident. 
    56                 $user_ident = folio_finduser($username); 
    57                 if ( !$user_ident ) { 
     57        if ( $user === false ) { 
    5858                        error('mod\folio\control\page_edit.php was called without a username parameter ' . 
    5959                                "or with an invalid one ($username)"); 
    60                 } 
    61                 $user_ident = $user_ident->ident; 
    62                  
     60                } else { 
     61            $user_ident = $user->ident; 
     62        } 
     63         
    6364                $page = new StdClass; 
    6465                $page->page_ident = $page_ident; 
     
    6970                $page->user_ident = $user_ident; 
    7071                $username = $username;           
     72        $created = 0; 
    7173                 
    7274    } else  { 
     
    7880                $security_ident = intval($page->security_ident); 
    7981                $user_ident = intval($page->user_ident); 
     82        $created = intval($page->created); 
    8083    } 
    81          
    82         // Include javascript for the tinymce rich editor. 
    8384 
    84         // Loose the trailing slash 
    85         $url = substr(url, 0, -1); 
    8685 
     86        // Include javascript for javascript validation. 
    8787        $metatags .= <<< END 
    88                 <SCRIPT type="text/javascript" src="$url/mod/folio/control/yav1_2_3/js_compact/yav.js"></SCRIPT> 
    89                 <SCRIPT type="text/javascript" src="$url/mod/folio/control/yav1_2_3/js_compact/yav-config.js"></SCRIPT> 
     88                <SCRIPT type="text/javascript" src="{$url}mod/folio/control/yav1_2_3/js_compact/yav.js"></SCRIPT> 
     89                <SCRIPT type="text/javascript" src="{$url}mod/folio/control/yav1_2_3/js_compact/yav-config.js"></SCRIPT> 
    9090            \n 
    9191<SCRIPT> 
     
    9595END; 
    9696 
    97  
    98  
    99     // Restore the trailing slash in $url 
    100         $url = url; 
    101      
     97    // Build control 
    10298    $run_result = <<< END 
    10399     
     
    130126 
    131127        // Include security 
    132         $run_result .= folio_control_page_edit_security( $page
     128        $run_result .= folio_control_page_edit_security( $page, $user
    133129                . folio_control_page_edit_move( $page ) ; 
    134130         
     
    140136                <input type="hidden" name="user_ident" value="{$user_ident}" /> 
    141137                <input type="hidden" name="page_ident" value="{$page_ident}" /> 
     138        <input type="hidden" name="created" value="{$created}" /> 
    142139                <!-- <input type="hidden" name="parentpage_ident" value="{$parentpage_ident}" /> --> 
    143140                <input type="submit" value="Save" /> 
  • folio/folio/control/page_edit_post.php

    r115 r117  
    3131        require_once('../../../includes.php'); 
    3232    global $db, $CFG; 
     33    global $messages; 
    3334     
    3435        // The security ident needs to be set by page_edit_security_post before this can run. 
     
    4849        $username = required_param('username'); 
    4950    $tags = required_param('page_tags'); 
     51    $old_created = required_param('created', PARAM_INT ); 
    5052         
    5153        // If the user isn't logged in, then set to -1 (anonymous) 
     
    5658                $page->creator_ident = -1;       
    5759        } 
    58          
     60     
     61    // Pickup last page to check for race condition ( another user edited & saved before we did) 
     62    $rec = get_record('folio_page','page_ident',$page->page_ident,'newest',1); 
     63        if ( (!($rec === false)) AND $rec->created <> $old_created ) { 
     64        // Add message 
     65        $messages[] = '<b>WARNING:  Another user changed the page in the time that you were ' . 
     66            'editing it.  Please click on the "History" menu option to view or restore their version.</b>'; 
     67             
     68    } 
     69     
    5970        // Modify old record by converting all records matching the conditions (folio, page, newest) to newest=false. 
    6071        set_field('folio_page', 'newest', 0, 'newest', 1, 'page_ident', $page->page_ident); 
     
    126137                         "WHERE type_ident IN ( SELECT activity_ident FROM {$CFG->prefix}folio_comment WHERE item_ident =  " . 
    127138                         " {$insert_id} AND item_type = 'page') AND type = 'page_comment'" ); 
    128     $returnvalue = $db->Execute($stmt);         
    129          
     139    $returnvalue = $db->Execute($stmt);    
     140 
     141 
    130142?> 
  • folio/folio/control/page_edit_security.php

    r101 r117  
    1313* @returns HTML control information.   
    1414*/ 
    15 function folio_control_page_edit_security( $page ) { 
     15function folio_control_page_edit_security( $page, $user) { 
    1616    // Find the security information for the page. 
    1717        global $CFG; 
     
    2323        $security_ident = intval($page->security_ident); 
    2424         
     25    // Build Labels 
     26    $labels = array( 
     27        'person-private'=>'Private (other people can not read or edit)', 
     28        'person-moderated'=>'Moderated (other people can read, but not edit)', 
     29        'person-public'=>'Public (everyone has full access)', 
     30        'community-private'=>'Private (only community members can read or edit)', 
     31        'community-moderated'=>'Moderated (everyone can can read, but only community members can edit)', 
     32        'community-public'=>'Public (everyone has full access)' 
     33        ); 
     34 
    2535        // Find out what security-level we're set at. 
    2636    $accesslevels = recordset_to_array( 
     
    4757                $oPrivate = ' SELECTED=true '; 
    4858        } 
    49          
     59     
    5060        // If the user isn't logged in, then they are not allowed to change the permission level for the page. 
     61    $oDisabled = ''; 
    5162        if ( !isloggedin() ) { 
    52                 // finish building the control, but mark it as disabled.. 
    53                 $run_result = <<< END 
    54                         <SELECT NAME="folio_control_page_edit_security_custom" DISABLED> 
    55                                 <OPTION VALUE="PUBLIC" {$oPublic}>Public (everyone has full access) 
    56                                 <OPTION VALUE="MODERATED" {$oModerated}>Moderated (other people can read, but not edit) 
    57                                 <OPTION VALUE="PRIVATE" {$oPrivate}>Private (other people can not read or edit) 
    58                         </SELECT><b> You must first log in to change permissions.</b> 
    59                 <br/> 
     63        $oDisabled = 'DISABLED'; 
     64        $oPermissions = 'You must first log in to change permissions.'; 
     65    } 
     66 
     67    // Build result 
     68    $run_result = <<< END 
     69        <SELECT NAME="folio_control_page_edit_security_custom" {$oDisabled}> 
     70            <OPTION VALUE="PUBLIC" {$oPublic}>{$labels[$user->user_type . '-public']} 
     71            <OPTION VALUE="MODERATED" {$oModerated}>{$labels[$user->user_type . '-moderated']} 
     72            <OPTION VALUE="PRIVATE" {$oPrivate}>{$labels[$user->user_type . '-private']} 
     73        </SELECT><b>{$oPermissions}</b> 
     74    <br/> 
    6075END; 
    61                  
    62         } else { 
    63                 // finish building the control. 
    64                 $run_result = <<< END 
    65                         <SELECT NAME="folio_control_page_edit_security_custom"> 
    66                                 <OPTION VALUE="PUBLIC" {$oPublic}>Public (everyone has full access) 
    67                                 <OPTION VALUE="MODERATED" {$oModerated}>Moderated (other people can read, but not edit) 
    68                                 <OPTION VALUE="PRIVATE" {$oPrivate}>Private (other people can not read or edit) 
    69                         </SELECT> 
    70                 <br/> 
    71 END; 
    72         } 
    73          
    74          
     76 
    7577        return templates_draw(array( 
    7678                                'context' => 'databoxvertical', 
  • folio/folio/control/tree.php

    r111 r117  
    310310    global $CFG; 
    311311    $address = $CFG->wwwroot . 'mod/folio/'; 
     312    $url = $CFG->wwwroot . 'page/'; 
    312313 
    313314    return <<< END 
  • folio/folio/control/tree_getdata.php

    r111 r117  
    2929    $page = get_record('folio_page','page_ident',$page_ident, 'newest', 1); 
    3030    $profile_id = $page->user_ident; 
     31    $user = get_record('users','ident',$profile_id); 
    3132     
    3233        $prefix = $CFG->prefix; 
     
    6263                $run_result .= intval($page->page_ident) . "\""; 
    6364                $run_result .= folio_tree_formattitle($page->title) . "\""; 
    64                         $run_result .= str_replace("\"", "'", folio_page_encodetitle( $page->title ) ) . "\""; 
     65                        $run_result .= $CFG->wwwroot . $user->username . "/page/" . str_replace("\"", "'", folio_page_encodetitle( $page->title ) ) . "\""; 
    6566 
    6667                        if ( is_null ($page->children ) ) { 
  • folio/folio/html/action_redirection.php

    r101 r117  
    2121global $messages; 
    2222global $page_owner; 
    23  
     23     
    2424// Test to make sure that we've got an action tag. 
    2525if (optional_param('action', '-1') == '-1') { 
     
    4343        require_once('../control/page_edit_post.php'); 
    4444    } 
     45 
    4546} elseif ( required_param ( 'action' ) == 'folio:page:delete' ) { 
    4647    // Delete a page. 
  • folio/folio/html/feeds.php

    r115 r117  
    3232            'wildcard' => false,  
    3333            'values' => array( 
    34                 'all' => array('name' => 'all', 'caption' => 'Everyone'),  
    35                 'fac' => array('name' => 'fac', 'caption' => 'Friends & Community'),  
    36                 'inbox' => array('name' => 'inbox', 'caption' => 'Inbox'),  
    37                 'user' => array('name' => 'user', 'caption' => 'Just Me'))), 
     34                'all' => array('name' => 'all', 'caption' => 'Everyone', 'showfor' => 'all'),  
     35                'fac' => array('name' => 'fac', 'caption' => 'Friends &amp; Community', 'showfor' => 'person'),  
     36                'inbox' => array('name' => 'inbox', 'caption' => 'Inbox', 'showfor' => 'all'),  
     37                'user' => array('name' => 'user', 'caption' => 'Just Me', 'showfor' => 'all'))), 
    3838        'format' => array(  
    3939            'var' => 'format',  
     
    4343            'wildcard' => false,  
    4444            'values' => array( 
    45                 'html' => array('name' => 'html', 'caption' => 'Full-text'),  
    46                 'summary' => array('name' => 'summary', 'caption' => 'Summary'))), 
     45                'html' => array('name' => 'html', 'caption' => 'Full-text', 'showfor' => 'all'),  
     46                'summary' => array('name' => 'summary', 'caption' => 'Summary', 'showfor' => 'all'))), 
    4747        'types' => array( 
    4848            'var' => 'types', 
     
    5252            'wildcard' => 'all',  
    5353            'values' => array( 
    54                 'weblog' => array('name' => 'weblog', 'caption' => 'Blog Posts'),  
    55                 'weblog_comment' => array('name' => 'weblog_comment', 'caption' => 'Blog Comments'), 
    56                 'file' => array('name' => 'file', 'caption' => 'Files'), 
    57                 'page' => array('name' => 'page', 'caption' => 'Wiki Page'), 
    58                 'page_comment' => array('name' => 'page_comment', 'caption' => 'Wiki Comments'))), 
     54                'weblog' => array('name' => 'weblog', 'caption' => 'Blog Posts', 'showfor' => 'all'),  
     55                'weblog_comment' => array('name' => 'weblog_comment', 'caption' => 'Blog Comments', 'showfor' => 'all'), 
     56                'file' => array('name' => 'file', 'caption' => 'Files', 'showfor' => 'all'), 
     57                'page' => array('name' => 'page', 'caption' => 'Wiki Page', 'showfor' => 'all'), 
     58                'page_comment' => array('name' => 'page_comment', 'caption' => 'Wiki Comments', 'showfor' => 'all'))), 
    5959        'username' => array( 
    6060            'var' => 'username', 
     
    330330 
    331331                $body = folio_feeds_controlbox( $arguments, $page ) .  
    332                         folio_control_htmlfeed( $results, $resultcount, $page, $arguments['username'] );  
     332                        folio_control_htmlfeed( $results, $resultcount, $page, $arguments['username'], false );  
    333333 
    334334                // Transfer into template & write. 
     
    355355 
    356356                $body = folio_feeds_controlbox( $arguments, $page ) .  
    357                         folio_control_summaryfeed( $results, $resultcount, $page,  
    358                             implode( ', ', $arguments['username'] ) );  
     357                        folio_control_htmlfeed( $results, $resultcount, $page,  
     358                            implode( ', ', $arguments['username'] ), true );  
    359359 
    360360                // Transfer into template & write. 
     
    413413function folio_feeds_controlbox( $arguments, $page ) { 
    414414    global $options; 
    415  
     415     
     416    // Get the user record, used later to only show appropriate options for communities. 
     417    $rec = get_record('users','username',$arguments['username'][0]); 
     418     
     419    // Start building HTML 
    416420    $html = '<table border=0 cellpadding=1 border-width=0 border-spacing=0>'; 
    417421 
     
    434438            // See if it's selected or not. 
    435439            foreach( $option['values'] as $option_value ) { 
    436  
    437                 if ( in_array( $option_value['name'], $arguments[$option['var']]) ) { 
    438                     // Selected 
    439                     $html .= ($option['displaymode'] == 'multiple' ? 
    440                                 ' <b><a href="' . 
    441                                 folio_feeds_url( $arguments, $page, array( array( 'name'=>$option['var'],'value' => $option_value['name'] ) ) ) .  
    442                                 '">' . $option_value['caption'] . "</a></b> |" 
    443                             : ' <b>' . $option_value['caption'] . '</b> |' ); 
    444                 } else { // !Selected 
    445                     $html .= ' <a href="' . 
    446                             folio_feeds_url( $arguments, $page, 
    447                                 // If multiple options, then keep existing option available. 
    448                                 //      Else, remove it.  
    449                                 ( $option['displaymode'] == 'multiple' ? 
    450                                 array( array('name'=>$option['var'],'value' => $option_value['name'] ) ) : 
    451                                 array( array('name'=>$option['var'], 'value' => $option_value['name'] ),  
    452                                     array('name'=>$option['var'],'value' => $arguments[$option['var']][0]) )  
    453                                  ) ) . 
    454                             '">' . $option_value['caption'] . "</a> |"; 
     440                // Show option value if it is enabled for the current user-type. 
     441                if ( $option_value['showfor'] == 'all' OR  
     442                    $option_value['showfor'] == $rec->user_type ) { 
     443                    // Look to see if the option is selected or not. 
     444                    if ( in_array( $option_value['name'], $arguments[$option['var']]) ) { 
     445                        // Selected 
     446                        $html .= ($option['displaymode'] == 'multiple' ? 
     447                                    ' <b><a href="' . 
     448                                    folio_feeds_url( $arguments, $page, array( array( 'name'=>$option['var'],'value' => $option_value['name'] ) ) ) .  
     449                                    '">' . $option_value['caption'] . "</a></b> |" 
     450                                : ' <b>' . $option_value['caption'] . '</b> |' ); 
     451                    } else { // !Selected 
     452                        $html .= ' <a href="' . 
     453                                folio_feeds_url( $arguments, $page, 
     454                                    // If multiple options, then keep existing option available. 
     455                                    //      Else, remove it.  
     456                                    ( $option['displaymode'] == 'multiple' ? 
     457                                    array( array('name'=>$option['var'],'value' => $option_value['name'] ) ) : 
     458                                    array( array('name'=>$option['var'], 'value' => $option_value['name'] ),  
     459                                        array('name'=>$option['var'],'value' => $arguments[$option['var']][0]) )  
     460                                     ) ) . 
     461                                '">' . $option_value['caption'] . "</a> |"; 
     462                    } 
    455463                } 
    456464            } 
     
    499507        implode( '+', $arguments['format']) . '/' . 
    500508        implode( '+', $arguments['types']) . '/' . 
    501         implode( '+', $arguments['tags']) . '/' . $page; 
     509        implode( '+', $arguments['tags']) . '/0'; // . $page; 
    502510} 
    503511 
  • folio/folio/lib.php

    r115 r117  
    178178        // Show link to activity. 
    179179        array_splice( $PAGE->menu, 0, 0, array( array( 'name' => 'folio_feeds',  
    180             'html' => '<li><a href="'.$CFG->wwwroot . 'activity/inbox/' . $currentusername . '/html/all/all/1">Your Activity</a></li>'))); 
     180            'html' => '<li><a href="'.$CFG->wwwroot . 'activity/fac/' . $currentusername . '/summary/all/all/1">Your Activity</a></li>'))); 
    181181    } 
    182182 
  • folio/folio/readme.txt

    r115 r117  
    11---------------------------------------------------------------------------------- 
    22                                Elgg Folio Add-in 
    3                                 Updated 6/25/2007 
     3                                Updated 7/1/2007 
    44---------------------------------------------------------------------------------- 
    55 
     
    9393 
    9494Occurred: 
     95        2007.07.01 v0.63 Fixed small bugs, made a number of minor enhancements. 
    9596        2007.06.25 v0.62 Fixed bugs.  Updated DB Scheme 
    9697        2007.06.06 v0.61 Fixed bugs.  Updated DB Scheme 
  • folio/folio/users_info_menu.php

    r111 r117  
    4040        $run_result .= folio_menu_inbox($username); 
    4141         
    42     $title = "<a href='{$url}activity/user/{$username}/html/all/all/1'>" . $displayname . 
     42    $body = "<li id='sidebar_folio'><h2><a href='{$url}activity/user/{$username}/html/all/all/1'>" . $displayname . 
    4343        "</a> <a href='{$url}activity/user/{$username}/rss/all/all/1:" . folio_createhash( $_SESSION['userid'] ) . 
    44         "'><img border=0 src='{$url}mod/folio/image/feed.png' alt='feed'/></a>"; 
     44        "'><img border=0 src='{$url}mod/folio/image/feed.png' alt='feed'/></a></h2>"; 
    4545 
    4646    // Side-bar links 
    47     $body = "<li id='sidebar_folio'><ul>"; 
     47    $body .= "<ul>"; 
    4848     
    4949    if ( !in_array( 'profile', $FOLIO_CFG->disabled_foliomenuitems ) ) { 
     
    6262     
    6363    // Build & Display to the screen. 
     64    /* 
    6465    $run_result .= templates_draw(array( 
    6566            'context' => 'sidebarholder', 
     
    6869            ) 
    6970        ); 
     71        */ 
     72    $run_result .= $body; 
     73     
    7074} elseif ( context == 'folio_page_view' ) { 
    7175        // Viewing our own page. 
     
    8892 
    8993    // Include add-in version. 
    90     $run_result .= '<a href="http://sl2.cgu.edu/elgg/elggfolioaddinlivesite' .  
    91         folio_version() . '"></a>'; 
     94    $run_result .= '<!-- elggfolioaddinlivesite' .  
     95        folio_version() . ' -->'; 
    9296 
    9397/** 
  • folio/readme.txt

    r116 r117  
    11---------------------------------------------------------------------------------- 
    22                                Elgg Folio Add-in 
    3                                 Updated 6/25/2007 
     3                                Updated 7/1/2007 
    44---------------------------------------------------------------------------------- 
    55 
     
    9393 
    9494Occurred: 
     95        2007.07.01 v0.63 Fixed small bugs, made a number of minor enhancements. 
    9596        2007.06.25 v0.62 Fixed bugs.  Updated DB Scheme 
    9697        2007.06.06 v0.61 Fixed bugs.  Updated DB Scheme