Plugin Directory

Changeset 558231


Ignore:
Timestamp:
06/14/2012 11:28:16 PM (14 years ago)
Author:
technosis
Message:

Ordering customization page elements based on weight

Location:
templ33t/branches/01_02_handling_posts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • templ33t/branches/01_02_handling_posts/plugs/templ33t_plugin.php

    r453652 r558231  
    3838     */
    3939    var $default;
     40   
     41    /**
     42     * Plugin weight order
     43     * @var int
     44     */
     45    var $weight;
    4046
    4147    /**
  • templ33t/branches/01_02_handling_posts/templ33t_object.php

    r558161 r558231  
    22852285        }
    22862286       
     2287        // order group items
     2288        foreach($groups as $key => $val) {
     2289            $order = array();
     2290            foreach($val as $key2 => $val2) {
     2291                $order[$key2] = $val2->weight;
     2292            }
     2293            asort($order, SORT_STRING);
     2294            $old = $val;
     2295            $groups[$key] = array();
     2296            foreach($order as $key2 => $val2) {
     2297                $groups[$key][$key2] = $old[$key2];
     2298            }
     2299        }
     2300       
    22872301        //print_r($groups);
    22882302       
Note: See TracChangeset for help on using the changeset viewer.