Changeset 1440

Show
Ignore:
Timestamp:
2008-03-07 03:00:16 (5 months ago)
Author:
freakerz
Message:

Merging r1439.

There are no changes yet in this branch as we made the merge into trunk early on.

This branch will be used to work Atom and APP validation/separation.

/me pokes michaeltwofish

Location:
branches/111307-atom
Files:
1 removed
78 modified
1 copied

Legend:

Unmodified
Added
Removed
  • branches/111307-atom/doc/manual/index.html

    r1291 r1440  
    734734        { 
    735735                if ( $plugin_id == $this->plugin_id() ) { 
    736                         $actions[] = _('Configure'); 
     736                        $actions[] = _t('Configure'); 
    737737                } 
    738738                return $actions; 
    739739        }</pre> 
    740 The _() function translates the string into the language used by the site.  For English-language blogs, the output would be "Configure", while for Spanish-language blogs, for example, the output might be "Configurar". 
     740The _t() function translates the string into the language used by the site.  For English-language blogs, the output would be "Configure", while for Spanish-language blogs, for example, the output might be "Configurar". 
     741The _e() function echoes a translated string for display. 
    741742<pre>public function action_plugin_ui( $plugin_id, $action ) 
    742743        { 
    743744                if ( $plugin_id == $this->plugin_id() ) { 
    744745                        switch ( $action ) { 
    745                                 case _('Configure') : 
     746                                case _t('Configure') : 
    746747                                        $ui = new FormUI( strtolower( get_class( $this ) ) ); 
    747                                         $customvalue= $ui->add( 'text', 'customvalue', _('Your custom value:') ); 
     748                                        $customvalue= $ui->add( 'text', 'customvalue', _t('Your custom value:') ); 
    748749                                        $ui->on_success( array( $this, 'updated_config' ) ); 
    749750                                        $ui->out(); 
  • branches/111307-atom/index.php

    r1291 r1440  
    2323 * The path to the root of this Habari installation. 
    2424 */ 
    25 define( 'HABARI_PATH', dirname( __FILE__ ) ); 
     25if( ! defined( 'HABARI_PATH' ) ) { 
     26    define( 'HABARI_PATH', dirname( __FILE__ ) ); 
     27} 
    2628 
    2729// We start up output buffering in order to take advantage of output compression, 
     
    153155} 
    154156 
     157// If we're doing unit testing, stop here 
     158if( defined( 'UNIT_TEST' ) ) { 
     159    return; 
     160} 
     161 
    155162// Send the Content-Type HTTP header. 
    156163// @todo Find a better place to put this. 
     
    188195// Flush (send) the output buffer. 
    189196ob_flush(); 
     197 
    190198?> 
  • branches/111307-atom/system/admin/admin.js

    r1291 r1440  
    33        $(this).hover( 
    44            function() { $(this).addClass(c);  }, 
    5             function() { $(this).removeClass(c); } 
     5            function() { $(this).removeClass(c); $('.menu-list').hide();} 
    66        ); 
    77    }); 
    88}; 
     9 
     10$.fn.resizeable = function(){ 
     11 
     12    this.each(function() { 
     13        var textarea = $(this); 
     14        var offset = null; 
     15        var grip = $('<div class="grip"></div>').mousedown(function(ev){ 
     16            offset = textarea.height() - (ev.clientY + document.documentElement.scrollTop) 
     17            $(document).mousemove(doDrag).mouseup(endDrag); 
     18        }).mouseup(endDrag); 
     19        var resizer = $('<div class="resizer"></div>').css('margin-bottom',$(this).css('margin-bottom')); 
     20        $(this).css('margin-bottom', '0px').wrap(resizer).parent().append(grip); 
     21 
     22        function doDrag(ev){ 
     23            textarea.height(Math.max(offset + ev.clientY + document.documentElement.scrollTop, 60) + 'px'); 
     24            return false; 
     25        } 
     26 
     27        function endDrag(ev){ 
     28            $(document).unbind('mousemove', doDrag).unbind('mouseup', endDrag); 
     29            textarea.css('opacity', 1.0); 
     30        } 
     31 
     32    }); 
     33} 
     34 
    935 
    1036String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); } 
     
    1945    }); 
    2046 
    21     $("#menu .menu-item").hover( 
     47    $("#oldmenu .menu-item").hover( 
    2248        function(){ $("ul", this).fadeIn("fast"); }, 
    2349        function() { } 
     
    2551 
    2652    if (document.all) { 
    27         $("#menu .menu-item").hoverClass("sfHover"); 
     53        $("#oldmenu .menu-item").hoverClass("iehover"); 
    2854    } 
    2955 
     
    6692    }); 
    6793 
    68     /* Resizable Textareas */ 
    69     $('textarea.resizable').each(function() { 
    70         var textarea = $(this); 
    71         var offset = null; 
    72         var grip = $('<div class="grip"></div>').mousedown(function(ev){ 
    73             offset = textarea.height() - (ev.clientY + document.documentElement.scrollTop) 
    74             $(document).mousemove(doDrag).mouseup(endDrag); 
    75         }).mouseup(endDrag); 
    76         var resizer = $('<div class="resizer"></div>').css('margin-bottom',$(this).css('margin-bottom')); 
    77         $(this).css('margin-bottom', '0px').wrap(resizer).parent().append(grip); 
    78  
    79         function doDrag(ev){ 
    80             textarea.height(Math.max(offset + ev.clientY + document.documentElement.scrollTop, 60) + 'px'); 
    81             return false; 
    82         } 
    83  
    84         function endDrag(ev){ 
    85             $(document).unbind('mousemove', doDrag).unbind('mouseup', endDrag); 
    86             textarea.css('opacity', 1.0); 
    87         } 
    88  
    89     }); 
     94    /* Make Textareas Resizable */ 
     95    $('.resizable').resizeable(); 
    9096 
    9197    /* Tabs, using jQuery UI Tabs */ 
     
    164170habari.editor = { 
    165171    insertSelection: function(value) { 
     172        if($('#content').filter('.islabeled').size() > 0) { 
     173            $('#content').filter('.islabeled') 
     174                .removeClass('islabeled') 
     175                .val(value); 
     176        } 
     177        else { 
     178            var contentel = $('#content')[0]; 
     179            if('selectionStart' in contentel) { 
     180                var content = $('#content').val(); 
     181                $('#content').val(content.substr(0, contentel.selectionStart) + value + contentel.value.substr(contentel.selectionEnd, content.length)); 
     182            } 
     183            else if(document.selection) { 
     184                contentel.focus(); 
     185                document.selection.createRange().text = value; 
     186            } 
     187            else { 
     188                $('#content').filter('.islabeled') 
     189                    .removeClass('islabeled') 
     190                    .val(value); 
     191            } 
     192        } 
     193    }, 
     194    getContents: function() { 
     195        return $('#content').val(); 
     196    }, 
     197    setContents: function(contents) { 
    166198        $('#content').filter('.islabeled') 
    167199            .val('') 
    168200            .removeClass('islabeled'); 
    169         $("#content").val($("#content").val() + value); 
     201        $('#content').val(contents) 
     202    }, 
     203    getSelection: function(contents) { 
     204        if($('#content').filter('.islabeled').size() > 0) { 
     205            return ''; 
     206        } 
     207        else { 
     208            var contentel = $('#content')[0]; 
     209            if('selectionStart' in contentel) { 
     210                return $('#content').val().substr(contentel.selectionStart, contentel.selectionEnd - contentel.selectionStart); 
     211            } 
     212            else if(document.selection) { 
     213                contentel.focus(); 
     214                var range = document.selection.createRange(); 
     215                if (range == null) { 
     216                    return ''; 
     217                } 
     218                return range.text; 
     219            } 
     220            else { 
     221                return $("#content").val(); 
     222            } 
     223        } 
    170224    } 
    171225}; 
  • branches/111307-atom/system/admin/css/admin.css

    r1291 r1440  
    9696    width: 105px; 
    9797    padding: 0 0 0 15px; 
    98     background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGlJREFUeNpinD59+mcGBgYeBtzgCxOQ6GPAD/pgit7hUPAOpugjHtNA4h+ZoJyJQPwCTcELqDgDTNEXIO5AU9QBFYcrAoHpQPwUyn4K5TOgK/oFxE1A/AhK/4JJsKBZsQCqaB+yIECAAQB0mBnahYs+3AAAAABJRU5ErkJggg==) 100px center no-repeat; /* png is dropdown arrow */ 
     98    /* background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGlJREFUeNpinD59+mcGBgYeBtzgCxOQ6GPAD/pgit7hUPAOpugjHtNA4h+ZoJyJQPwCTcELqDgDTNEXIO5AU9QBFYcrAoHpQPwUyn4K5TOgK/oFxE1A/AhK/4JJsKBZsQCqaB+yIECAAQB0mBnahYs+3AAAAABJRU5ErkJggg==) 100px center no-repeat; /* png is dropdown arrow */ 
     99    background: url(../images/bar-back-drop.png) 100px center no-repeat; 
    99100    } 
    100101 
     
    110111    } 
    111112 
    112 #oldmenu li.menu-item:hover ul { 
     113#oldmenu li.menu-item:hover ul, #oldmenu li.menu-item.iehover ul { 
    113114    top: 22px; 
    114115    } 
     
    123124    } 
    124125 
    125 #oldmenu li.menu-item:hover .menu-list a:hover { 
     126#oldmenu li.menu-item:hover .menu-list a:hover, #oldmenu li.menu-item.iehover .menu-list a:hover { 
    126127    color: white; 
    127128    background: #333; 
    128129    } 
    129  
    130  
    131  
    132 /* The NEW HOTNESS Menu */ 
    133  
    134 #menu { 
    135     position: fixed; 
    136     top: 0; 
    137     height: 32px; 
    138     padding: 0 0px; 
    139     width: 100%; 
    140     font-size: 1.2em; 
    141     background: #242424 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAICAIAAAC3eAIWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABhJREFUeNpikpOTY2JgYABjRkZGdAwQYAAMYgB6RRurTwAAAABJRU5ErkJggg==) repeat-x top; /* Top dropshadow */ 
    142     } 
    143  
    144 #menu li { 
    145     display: inline; 
    146     } 
    147  
    148 #menu li#site-name { 
    149     float: right; 
    150     margin-right: 10px; 
    151     } 
    152  
    153 #menu li#site-name a { 
    154     padding: 0 20px 0 20px; 
    155     border: none; 
    156     } 
    157  
    158 #menu > li > a { 
    159     font-family: 'HelveticaNeue-Light', 'Helvetica Neue', Helvetica, Arial, Sans-Serif; 
    160     } 
    161  
    162 #menu li a { 
    163     color: white; 
    164     line-height: 32px; 
    165     text-decoration:none; 
    166     display: block; 
    167     } 
    168  
    169 #menu li.menu-item:hover a, #menu li#site-name a:hover { 
    170     background-color: #424242; 
    171     } 
    172  
    173 #menu > .menu-item { 
    174     float: left; 
    175     } 
    176  
    177 #menu #contentmenu { 
    178     border-left: 1px solid #131313; 
    179     margin-left: 10px; 
    180     } 
    181  
    182 #menu #adminmenu { 
    183     border-left: 1px solid #131313; 
    184     border-right: 1px solid #131313; 
    185     } 
    186  
    187 #menu > .menu-item > a { 
    188     width: 105px; 
    189     padding: 0 0 0 15px; 
    190     background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGlJREFUeNpinD59+mcGBgYeBtzgCxOQ6GPAD/pgit7hUPAOpugjHtNA4h+ZoJyJQPwCTcELqDgDTNEXIO5AU9QBFYcrAoHpQPwUyn4K5TOgK/oFxE1A/AhK/4JJsKBZsQCqaB+yIECAAQB0mBnahYs+3AAAAABJRU5ErkJggg==) 100px center no-repeat; /* png is dropdown arrow */ 
    191     } 
    192  
    193 #menu li.menu-item > ul { 
    194     position: absolute; 
    195     top: -10000px; 
    196     min-width: 120px; 
    197     max-width: 250px; 
    198     margin: 10px 0 0 -1px; 
    199     } 
    200  
    201 .menu-list { 
    202     background: #e1e1e1; 
    203     border: 1px solid #b0b0b0; 
    204     border-top: none; 
    205     padding: 5px 0; 
    206     } 
    207  
    208 #menu li.menu-item:hover ul { 
    209     top: 22px; 
    210     } 
    211  
    212 #menu li.menu-item .menu-list a { 
    213     width: auto; 
    214     font-size: .8em; 
    215     line-height: 1.6em; 
    216     color: #333; 
    217     padding: 3px 15px; 
    218     background: none; 
    219     } 
    220  
    221 #menu .submenuitems { 
    222     margin: 0; 
    223     } 
    224  
    225 #menu .submenuitems a { 
    226     font-size: .75em !important; 
    227     padding-left: 25px !important; 
    228     color: #777 !important; 
    229     } 
    230  
    231 #menu .menu-list li { 
    232     display: block; 
    233     } 
    234  
    235 #menu #createpagelink { 
    236     padding-bottom: 5px; 
    237     border-bottom: 1px solid #bbb; 
    238     } 
    239  
    240 #menu #managecontentlink { 
    241     padding-top: 5px; 
    242     } 
    243  
    244 #menu li.menu-item:hover .menu-list a:hover { 
    245     color: white !important; 
    246     background: #333; 
    247     } 
    248  
    249  
    250130 
    251131/* Page Splitter Tabs */ 
     
    464344/* BluePrint Overrides */ 
    465345 
    466 #plugin_options { 
    467     background: #3A3A3A; 
     346#plugin_options, #theme_options { 
     347    background: #333333 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAVCAYAAACHUoQEAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEBJREFUeNpiYGBgSGICEowg4i+I+AMnfoGI33ACzP0FxAxmIMIARGiBCBUQIQciJEGECIjgAxFcIIINRDADBBgAlsIJb8O3yoQAAAAASUVORK5CYII=) top repeat-x; /* Drop shadow */ 
    468348    border-top: 1px solid #C0C0C0; 
    469349    border-bottom: 1px solid #C0C0C0; 
     
    473353} 
    474354 
    475 #plugin_options h2 { 
     355#plugin_options h2, #theme_options h2 { 
    476356    color: white; 
    477357} 
  • branches/111307-atom/system/admin/dashboard.php

    r1291 r1440  
    207207  </div> 
    208208  <hr> 
    209   <div class="column prepend-7 span-16 first"> 
     209  <div class="column prepend-8 span-15 first"> 
    210210    <h3>Drafts (<a href="<?php URL::out( 'admin', 'page=content' ); ?>#drafts" title="View Your Drafts">more</a> &raquo;)</h3> 
    211211    <?php 
  • branches/111307-atom/system/admin/groups.php

    r1291 r1440  
    1515<ul> 
    1616<?php 
    17 foreach ( $groups as $id => $name ) 
    18 { 
    19         echo '<li>'; 
    20         echo '<form method="post" action=""><input type="hidden" name="group" value="' . $id . '"><input type="submit" name="delete_group" value="Delete"> '; 
     17foreach ( $groups as $group ) { 
     18    echo '<li>'; 
     19    echo '<form method="post" action=""><input type="hidden" name="group" value="' . $group->name . '"><input type="submit" name="delete_group" value="Delete"> '; 
    2120    echo '<input type="submit" name="edit_group" value="Edit"> '; 
    22     echo $name . '</form>'; 
    23         echo '</li>'; 
     21    echo $group->name . '</form>'; 
     22    echo '</li>'; 
    2423} 
    2524?> 
     
    2928<p>Members</p> 
    3029<?php 
    31 if ( isset( $group ) ) { 
     30if ( isset( $group_edit ) ) { 
    3231    if ( isset( $users) && ( ! empty( $users ) ) ) { 
     32        echo '<p>Editing members of ' . $group_edit->name . '</p>'; 
    3333        echo '<form method="post" action="">'; 
    34         echo '<input type="hidden" name="group" value="' . $group . '">'; 
    35         echo Utils::html_select( 'add_user', $users ); 
    36         echo ' <input type="submit" value="Add"></form>'; 
    37     } 
    38     if ( ! empty($group_members) ) { 
    39             echo '<ul>'; 
    40             foreach ( $group_members as $member ) { 
    41                     $user= User::get_by_id($member); 
    42                     echo '<li><form method="post" action=""><input type="hidden" name="remove_user" value="' . $user->id . '">'; 
    43             echo '<input type="hidden" name="user_group" value="' . $group . '"><input type="submit" value="Remove"></form> ' . $user->username . '</li>'; 
    44             } 
    45             echo '</ul>'; 
     34        echo '<input type="hidden" name="group" value="' . $group_edit->name . '">'; 
     35        foreach ( $users as $user ) { 
     36            echo '<input type="checkbox" name="user_id[]" value="' . $user->id . '"'; 
     37            if ( in_array( $user->id, $group_edit->members ) ) { 
     38                echo ' checked'; 
     39            } 
     40            echo '"> ' . $user->username . '<br>'; 
     41        } 
     42        echo '<input type="submit" name="users" value="Submit"></form>'; 
    4643    } else { 
    4744        echo '<p>No members.</p>'; 
     
    5249<div class="column span-8 last"> 
    5350<p>Permissions</p> 
     51<?php 
     52if ( isset( $group_edit ) ) { 
     53    if ( isset( $permissions) && ( ! empty( $permissions ) ) ) { 
     54        echo '<p>Editing Permissions of ' . $group_edit->name . '</p>'; 
     55        echo '<form method="post" action="">'; 
     56        echo '<input type="hidden" name="group" value="' . $group_edit->name . '">'; 
     57        echo '<table><tr><th>Granted</th><th>Permission</th><th>Denied</th></tr>'; 
     58        foreach( $permissions as $perm ) { 
     59            echo '<tr>'; 
     60            if(  isset( $permissions_granted[ $perm->id ] ) ) { 
     61                // indicate that this permission is granted 
     62            } elseif ( isset( $permissions_denied[ $perm->id ] ) ) { 
     63                // indicate that this permission is denied 
     64            } 
     65            echo "<td><input type='checkbox' name='grant[]' value='{$perm->id}'"; 
     66            if ( in_array( $perm->id, $permissions_granted ) ) { 
     67                echo ' checked'; 
     68            } 
     69            echo "></td><td> {$perm->description} </td><td>"; 
     70            echo "<input type='checkbox' name='deny[]' value='{$perm->id}'"; 
     71            if ( in_array( $perm->id, $permissions_denied ) ) { 
     72                echo ' checked'; 
     73            } 
     74            echo '></td></tr>'; 
     75        } 
     76        echo '<tr><td colspan="3"><input type="submit" name="permissions" value="' . _t('Submit') . '"></td>'; 
     77        echo '</table></form>'; 
     78    } else { 
     79        echo '<p>No permissions.</p>'; 
     80    } 
     81} 
     82?> 
    5483</div> 
    5584</div> 
  • branches/111307-atom/system/admin/header.php

    r1291 r1440  
    33<head> 
    44    <title>Habari Administration</title> 
    5  
     5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    66    <link rel="stylesheet" href="<?php Site::out_url('habari'); ?>/3rdparty/blueprint/screen.css" type="text/css" media="screen, projection"> 
    77    <link rel="stylesheet" href="<?php Site::out_url('habari'); ?>/3rdparty/blueprint/print.css" type="text/css" media="print"> 
  • branches/111307-atom/system/admin/login.php

    <
    r1291 r1440  
    2525        } 
    2626 
    27         #databasesetup { 
     27        #loginform { 
    2828            margin:0 auto; 
    2929        } 
     
    3737            margin-bottom: 50px; 
    3838        } 
     39        .notice, .error { 
     40            margin-left:auto; 
     41            margin-right:auto; 
     42            width:552px; 
     43        } 
    3944 
    4045        </style> 
    4146</head> 
    4247<body> 
    43 <ul id="menu"> 
     48<ul id="oldmenu"> 
    4449    <li id="site-name"> 
    4550        <a href="<?php Site::out_url('habari'); ?>" title="<?php Options::out('title'); ?>"><?php Options::out('title'); ?></a> 
    4651    </li> 
    47  
    4852</ul> 
    4953 
     54<div style="min-height:45px;"> 
     55<?php 
     56