Changeset 5773

Show
Ignore:
Timestamp:
04/20/07 15:08:17 (2 years ago)
Author:
rambo
Message:

Adrenalin:

- Fixed bug in sorting more than 9 mixed objects (inserted leading zeros for each ID before sorting the elements alphabetically)
- Improved user interface
- Added constraint to prevent reply articles (up <> 0) from appearing
- Removed XML prologues (<![CDATA[]]>)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/midcom.admin.folder/config/manifest.inc

    r5203 r5773  
    2323        ( 
    2424            'name' => 'Arttu Manninen', 
    25             'email' => 'arttu.manninen@protie.fi', 
    26             'role' => 'developer', 
     25            'email' => 'arttu@kaktus.cc', 
     26            'role' => 'lead', 
    2727        ), 
    2828        'torben' => Array 
     
    3939    ), 
    4040), 
    41  
    42  
  • trunk/src/midcom.admin.folder/documentation/CHANGES

    r5715 r5773  
    77- All items marked with "+" represent completly new features. 
    88 
    9 2007-04-16 bergie 
    10   + Added initial support for moving objects 
     92007-04-20 adrenalin 
     10  - Fixed bug in sorting more than 9 mixed objects (inserted leading zeros for each ID before 
     11    sorting the elements alphabetically) 
     12  - Improved user interface 
     13  - Added constraint to prevent reply articles (up <> 0) from appearing 
     14  - Removed XML prologues (<![CDATA[]]>) 
     15 
     162007-02-06 adrenalin 
     17  - Rollback to previous version of metadata editor: backporting from SVN trunk won't work 
    1118 
    12192007-02-02 adrenalin 
     20  ! Backported to MidCOM 2.6 branch 
    1321  + Moved delete folder request to use static method instead of an independent function 
    1422    and converted it to use midgard_query_builder instead of midcom_helper_nav (latter 
  • trunk/src/midcom.admin.folder/handler/create.php

    r5205 r5773  
    208208        ); 
    209209         
     210        // loads and populats request_array['components'] 
     211        $style_default = array 
     212        ( 
     213            '' => $_MIDCOM->i18n->get_string('default', 'midcom.admin.folder'), 
     214        ); 
     215         
     216        $styles_all = midcom_admin_folder_folder_management::list_styles(); 
     217         
     218        $this->_request_data['styles'] = array_merge($style_default, $styles_all); 
     219         
    210220        // Show the style element 
    211221        midcom_show_style('midcom-admin-show-create-folder'); 
  • trunk/src/midcom.admin.folder/handler/order.php

    r5151 r5773  
    4040        if ($_POST['f_navorder'] != $this->_topic->parameter('midcom.helper.nav', 'navorder')) 
    4141        { 
    42             $this->_topic->parameter('midcom.helper.nav', 'navorder', $_POST['f_navorder']); 
    43             return true; 
     42            $this->_topic->set_parameter('midcom.helper.nav', 'navorder', $_POST['f_navorder']); 
     43            return false; 
    4444            // This will exit. 
    4545        } 
     
    5252            { 
    5353                $article = new midcom_db_article($id); 
    54                 $article->score = $key; 
     54                $article->score = (int) $key; 
    5555                $article->metadata->score = (int) $count - $key; 
    5656                 
     
    9595            { 
    9696                $topic = new midcom_db_topic($id); 
    97                 $topic->score = $key; 
     97                $topic->score = (int) $key; 
    9898                $topic->metadata->score = (int) $count - $key; 
    9999                 
     
    169169                } 
    170170                 
    171                 $object->score = $key; 
     171                $object->score = (int) $key; 
    172172                 
    173173                debug_add("Setting the score for {$type[1]} id '{$id}: {$key}", MIDCOM_LOG_DEBUG); 
     
    194194         
    195195        debug_pop(); 
     196         
     197        return true; 
    196198    } 
    197199     
     
    226228        if (array_key_exists('f_submit', $_REQUEST)) 
    227229        { 
    228             $this->_process_order_form(); 
    229             $_MIDCOM->relocate($_MIDCOM->permalinks->create_permalink($this->_topic->guid)); 
     230            if ($this->_process_order_form()) 
     231            { 
     232                $_MIDCOM->relocate($_MIDCOM->permalinks->create_permalink($this->_topic->guid)); 
     233            } 
    230234            // This will exit 
    231235        } 
     
    233237        // Add the view to breadcrumb trail 
    234238        $tmp = array(); 
     239         
    235240        $tmp[] = array 
    236241        ( 
     
    287292        $qb->add_constraint('topic', '=', $this->_topic->id); 
    288293        $qb->add_constraint('name', '<>', 'index'); 
     294        $qb->add_constraint('up', '=', 0); 
    289295        $qb->add_order('score'); 
    290296        //$qb->add_order('name'); 
     
    331337                foreach ($this->_request_data['folders'] as $topic) 
    332338                { 
    333                     $this->_request_data['mixed'][$topic->score . '_' . $topic->id . '_folder'] = $topic->extra; 
     339                    $score = $this->_get_score($topic->score); 
     340                    $this->_request_data['mixed'][$score . '_' . $topic->id . '_folder'] = $topic->extra; 
    334341                } 
    335342                 
    336343                foreach ($this->_request_data['pages'] as $article) 
    337344                { 
    338                     $this->_request_data['mixed'][$article->score . '_' . $article->id . '_page'] = $article->title; 
     345                    $score = $this->_get_score($article->score); 
     346                    $this->_request_data['mixed'][$score . '_' . $article->id . '_page'] = $article->title; 
    339347                } 
    340348                 
     
    369377        midcom_show_style('midcom-admin-show-order-footer'); 
    370378    } 
     379     
     380    /** 
     381     * Fill a given integer with zeros for alphabetic ordering 
     382     *  
     383     * @access private 
     384     * @param int $int    Integer 
     385     * @return string     String filled with leading zeros 
     386     */ 
     387    function _get_score($int) 
     388    { 
     389        $string = (string) $int; 
     390         
     391        while (strlen($string) < 5) 
     392        { 
     393            $string = "0{$string}"; 
     394        } 
     395         
     396        return $string; 
     397    } 
    371398} 
    372399?> 
  • trunk/src/midcom.admin.folder/locale/default.en.txt

    r5715 r5773  
    1212---STRINGEND 
    1313 
     14---STRING all style elements 
     15All style elements 
     16---STRINGEND 
     17 
    1418---STRING are you sure you want to delete this folder 
    1519Are you sure you want to delete this folder? 
     
    3236---STRINGEND 
    3337 
     38---STRING component default 
     39Component default 
     40---STRINGEND 
     41 
     42---STRING copy to editor 
     43Copy to editor 
     44---STRINGEND 
     45 
    3446---STRING create folder 
    3547Create folder 
     
    88100---STRINGEND 
    89101 
     102---STRING edit layout template 
     103Edit layout template 
     104---STRINGEND 
     105 
    90106---STRING edit metadata 
    91107Edit metadata 
     
    144160---STRINGEND 
    145161 
     162---STRING nav order 
     163Order of navigation items 
     164---STRINGEND 
     165 
     166---STRING new layout template 
     167[New layout template] 
     168---STRINGEND 
     169 
     170---STRING no sortable elements found 
     171No sortable elements found 
     172---STRINGEND 
     173 
     174---STRING no url name specified 
     175No URL name specified! 
     176---STRINGEND 
     177 
     178---STRING order navigation 
     179Arrange navigation items 
     180---STRINGEND 
     181 
     182---STRING order navigation in folder %s 
     183Arrange navigation under folder "%s" 
     184---STRINGEND 
     185 
     186---STRING owner 
     187Owner 
     188---STRINGEND 
     189 
     190---STRING pages first 
     191Pages first 
     192---STRINGEND 
     193 
     194---STRING prevent entering 
     195Prevent entering 
     196---STRINGEND 
     197 
     198---STRING privilege template_management 
     199Layout template management 
     200---STRINGEND 
     201 
     202---STRING privilege topic_management 
     203Folder management 
     204---STRINGEND 
     205 
     206---STRING published 
     207Published 
     208---STRINGEND 
     209 
     210---STRING revised 
     211Revised 
     212---STRINGEND 
     213 
     214---STRING revision 
     215Revision 
     216---STRINGEND 
     217 
     218---STRING revisor 
     219Revisor 
     220---STRINGEND 
     221 
     222---STRING schedule end 
     223Display until (leave empty for unlimited display) 
     224---STRINGEND 
     225 
     226---STRING schedule start 
     227Publish at (leave empty for immediate publication) 
     228---STRINGEND 
     229 
     230---STRING scheduling 
     231Scheduling 
     232---STRINGEND 
     233 
     234---STRING select the ordering method first to sort the pages 
     235Select the ordering method first to sort the pages 
     236---STRINGEND 
     237 
     238---STRING size 
     239Size 
     240---STRINGEND 
     241 
     242---STRING sort by score 
     243Sort by score 
     244---STRINGEND 
     245 
     246---STRING sort folders 
     247Sort folders 
     248---STRINGEND 
     249 
     250---STRING sort pages 
     251Sort pages 
     252---STRINGEND 
     253 
     254---STRING style 
     255Style template 
     256---STRINGEND 
     257 
     258---STRING style editor 
     259Style editor 
     260---STRINGEND 
     261 
     262---STRING style element list 
     263List of style elements 
     264---STRINGEND 
     265 
     266---STRING style elements for %s 
     267Style elements for style %s 
     268---STRINGEND 
     269 
     270---STRING title is empty 
     271Title is empty! 
     272---STRINGEND 
     273 
     274---STRING warning, might result in data loss 
     275Warning! Might result in data loss! 
     276---STRINGEND 
     277 
     278---STRING saving changes 
     279Saving changes 
     280---STRINGEND 
     281 
    146282---STRING move 
    147283Move 
    148284---STRINGEND 
    149285 
    150 ---STRING nav order 
    151 Order of navigation items 
    152 ---STRINGEND 
    153  
    154 ---STRING new layout template 
    155 [New layout template] 
    156 ---STRINGEND 
    157  
    158 ---STRING no sortable elements found 
    159 No sortable elements found 
    160 ---STRINGEND 
    161  
    162 ---STRING no url name specified 
    163 No URL name specified! 
    164 ---STRINGEND 
    165  
    166 ---STRING order navigation 
    167 Arrange navigation items 
    168 ---STRINGEND 
    169  
    170 ---STRING order navigation in folder %s 
    171 Arrange navigation under folder "%s" 
    172 ---STRINGEND 
    173  
    174 ---STRING owner 
    175 Owner 
    176 ---STRINGEND 
    177  
    178 ---STRING pages first 
    179 Pages first 
    180 ---STRINGEND 
    181  
    182 ---STRING prevent entering 
    183 Prevent entering 
    184 ---STRINGEND 
    185  
    186 ---STRING privilege template_management 
    187 Layout template management 
    188 ---STRINGEND 
    189  
    190 ---STRING privilege topic_management 
    191 Folder management 
    192 ---STRINGEND 
    193  
    194 ---STRING published 
    195 Published 
    196 ---STRINGEND 
    197  
    198 ---STRING revised 
    199 Revised 
    200 ---STRINGEND 
    201  
    202 ---STRING revision 
    203 Revision 
    204 ---STRINGEND 
    205  
    206 ---STRING revisor 
    207 Revisor 
    208 ---STRINGEND 
    209  
    210 ---STRING schedule end 
    211 Display until (leave empty for unlimited display) 
    212 ---STRINGEND 
    213  
    214 ---STRING schedule start 
    215 Publish at (leave empty for immediate publication) 
    216 ---STRINGEND 
    217  
    218 ---STRING scheduling 
    219 Scheduling 
    220 ---STRINGEND 
    221  
    222 ---STRING select the ordering method first to sort the pages 
    223 Select the ordering method first to sort the pages 
    224 ---STRINGEND 
    225  
    226 ---STRING size 
    227 Size 
    228 ---STRINGEND 
    229  
    230 ---STRING sort by score 
    231 Sort by score 
    232 ---STRINGEND 
    233  
    234 ---STRING sort folders 
    235 Sort folders 
    236 ---STRINGEND 
    237  
    238 ---STRING sort pages 
    239 Sort pages 
    240 ---STRINGEND 
    241  
    242 ---STRING style 
    243 Style template 
    244 ---STRINGEND 
    245  
    246286---STRING title is empty 
    247287Title is empty! 
     
    255295Move %s 
    256296---STRINGEND 
    257  
  • trunk/src/midcom.admin.folder/locale/default.fi.txt

    r5715 r5773  
    248248---STRINGEND 
    249249 
     250---STRING list of %s folders using the same style template path 
     251Lista komponenttia "%s" kÀyttÀvistÀ kansioista, joissa kÀytetÀÀn samaa tyylipolkua 
     252---STRINGEND 
     253 
     254---STRING style element list 
     255Tyylielementtilista 
     256---STRINGEND 
     257 
     258---STRING style elements for %s 
     259Tyylielementit tyylille %s 
     260---STRINGEND 
     261 
     262---STRING all style elements 
     263Kaikki tyylielementit 
     264---STRINGEND 
     265 
     266---STRING component default 
     267Komponentin vakiotyyli 
     268---STRINGEND 
     269 
     270---STRING edit %s 
     271Muokkaa kohdetta '%s' 
     272---STRINGEND 
     273 
     274---STRING local element 
     275Paikallinen elementti 
     276---STRINGEND 
     277 
     278---STRING copy to editor 
     279Kopioi editoriin 
     280---STRINGEND 
     281 
     282---STRING style editor 
     283Ulkoasueditori 
     284---STRINGEND 
     285 
     286---STRING submitting the form 
     287Tallennetaan muutos 
     288---STRINGEND 
     289 
  • trunk/src/midcom.admin.folder/static/midcom-admin-order.css

    r4032 r5773  
    99  font-weight: bold; 
    1010} 
     11 
     12#midcom_admin_folder_show_save_info 
     13{ 
     14  background-image: url('../midcom.helper.datamanager2/ajax-loading-black.gif'); 
     15  background-repeat: no-repeat; 
     16  background-position: center center; 
     17  background-color: black; 
     18  color: white; 
     19  padding: 1em; 
     20  display: none; 
     21} 
  • trunk/src/midcom.admin.folder/style/midcom-admin-show-order-folders.php

    r5049 r5773  
    1111?> 
    1212        </ul> 
    13         <script> 
    14         Sortable.create('midcom_admin_content_folders_list'); 
     13        <script type="text/javascript"> 
     14            // <!-- 
     15                Sortable.create('midcom_admin_content_folders_list'); 
     16            // --> 
    1517        </script> 
    1618    </div> 
  • trunk/src/midcom.admin.folder/style/midcom-admin-show-order-header.php

    r5151 r5773  
    1 <script> 
    2 function midcom_admin_content_hide_ordering_lists() 
    3 
    4     var elements = document.getElementsByClassName('midcom-admin-order'); 
    5     var i = 0; 
    6      
    7     for (i = 0; i < elements.length; i++) 
    8     { 
    9         var element = elements[i]; 
    10         element.style.display = 'none'; 
    11     } 
    12 
     1<script type="text/javascript"> 
     2    // <!-- 
     3        function disable_sorting() 
     4        { 
     5            document.getElementById('midcom_admin_folder_show_save_info').style.display = 'block'; 
     6            var input = document.createElement('input'); 
     7            input.type = 'hidden'; 
     8            input.name = 'f_submit'; 
     9            input.value = 'submit'; 
     10             
     11            document.getElementById('midcom_admin_folder_order_form').appendChild(input); 
     12            document.getElementById('midcom_admin_folder_order_form').submit(); 
     13        } 
     14    // --> 
    1315</script> 
    14 <?php 
    15 //$data =& $_MIDCOM->get_custom_context_data('request_data'); 
    16 ?> 
    1716<h1><?php echo $data['title']; ?></h1> 
    18 <form method="post" action="" enctype="multipart/form-data" id="midcom_admin_content_order_form" class="datamanager midcom_admin_folder sort_folder"> 
     17<form method="post" action="" enctype="multipart/form-data" id="midcom_admin_folder_order_form" class="datamanager midcom_admin_folder sort_folder"> 
    1918    <label for="midcom_admin_content_order_navorder"> 
    20         <select name="f_navorder" id="midcom_admin_content_order_navorder" onChange="midcom_admin_content_hide_ordering_lists();"> 
     19        <select name="f_navorder" id="midcom_admin_folder_order_navorder" onChange="javascript:disable_sorting();"> 
    2120<?php 
    2221foreach ($data['navorder_list'] as $key => $value) 
     
    3736        </select> 
    3837    </label> 
     38    <p id="midcom_admin_folder_show_save_info" style=""> 
     39        <?php echo $_MIDCOM->i18n->get_string('saving changes', 'midcom.admin.folder'); ?> 
     40    </p> 
  • trunk/src/midcom.admin.folder/style/midcom-admin-show-order-mixed.php

    r5048 r5773  
    1     <div class="midcom-admin-order" style="display: block;"> 
    21<?php 
    32//$data =& $_MIDCOM->get_custom_context_data('request_data'); 
    43?> 
     4    <div class="midcom-admin-order" style="display: block;"> 
    55        <h3><?php echo $_MIDCOM->i18n->get_string('sort by score', 'midcom.admin.folder'); ?></h3> 
    66        <ul id="midcom_admin_content_mixed_list" class="mixed sortable"> 
     
    2424?> 
    2525        </ul> 
    26         <script> 
    27         Sortable.create('midcom_admin_content_mixed_list'); 
     26        <script type="text/javascript"> 
     27            // <!-- 
     28                Sortable.create('midcom_admin_content_mixed_list'); 
     29            // --> 
    2830        </script> 
    2931    </div> 
  • trunk/src/midcom.admin.folder/style/midcom-admin-show-order-pages.php

    r5048 r5773  
    1414?> 
    1515        </ul> 
    16         <script> 
    17         Sortable.create('midcom_admin_content_pages_list'); 
     16        <script type="text/javascript"> 
     17            // <!-- 
     18                Sortable.create('midcom_admin_content_pages_list'); 
     19            // --> 
    1820        </script> 
    1921    </div>