Changeset 14082

Show
Ignore:
Timestamp:
12/21/07 21:33:34 (8 months ago)
Author:
flack
Message:

some phpdoc fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/cc.kaktus.exhibitions/viewer.php

    r11737 r14082  
    2222        parent::midcom_baseclasses_components_request($topic, $config); 
    2323    } 
    24      
     24 
    2525    /** 
    2626     * Set the accepted request switches 
    27      *  
     27     * 
    2828     * @access public 
    2929     * @return void 
     
    3737            'handler' => array ('cc_kaktus_exhibitions_handler_list', 'years'), 
    3838        ); 
    39          
     39 
    4040        // Exhibition editing 
    4141        // Match /edit/<event guid>/ 
     
    4646            'variable_args' => 1, 
    4747        ); 
    48          
     48 
    4949        // Delete an exhibition 
    5050        // Match /delete/<event guid>/ 
     
    5555            'variable_args' => 1, 
    5656        ); 
    57          
     57 
    5858        // Create an exhibition 
    5959        // Match /create/<schema layout>/ 
     
    6464            'variable_args' => 1, 
    6565        ); 
    66          
     66 
    6767        // Create a subevent for an exhibition 
    6868        // Match /create/<schema layout>/<event guid>/ 
     
    7373            'variable_args' => 2, 
    7474        ); 
    75          
     75 
    7676        // Delete an event 
    7777        // Match /delete/<event guid>/ 
     
    8282            'variable_args' => 1, 
    8383        ); 
    84          
     84 
    8585        // Show attachments and subpages of an exhibition 
    8686        // Match /list/<type>/<event guid>/ 
     
    9191            'variable_args' => 2, 
    9292        ); 
    93          
     93 
    9494        // Show the ongoing exhibition page 
    9595        // Match /current/ 
     
    107107            'fixed_args' => array ('future'), 
    108108        ); 
    109          
     109 
    110110        // Match /past/ 
    111111        $this->_request_switch['past'] = array 
     
    114114            'fixed_args' => array ('past'), 
    115115        ); 
    116          
     116 
    117117        // Match /config/ 
    118118        $this->_request_switch['config'] = array 
     
    121121            'fixed_args' => array ('config'), 
    122122        ); 
    123          
     123 
    124124        // Show listing for requested year 
    125125        // Match /<year>/ 
     
    129129            'variable_args' => 1, 
    130130        ); 
    131          
     131 
    132132        // Show an event 
    133133        // Match /<year>/<event name>/ 
     
    137137            'variable_args' => 2, 
    138138        ); 
    139          
     139 
    140140        // Show event details if applicable 
    141141        // Match /<year>/<event extra>/<subpage extra>/ 
     
    146146        ); 
    147147    } 
    148      
     148 
    149149    /** 
    150150     * Load the master event for exhibition listing 
    151      *  
     151     * 
    152152     * @access private 
    153153     * @return boolean Indicating success 
     
    165165            $this->_request_data['master_event']->start = 0; 
    166166            $this->_request_data['master_event']->end = 0; 
    167              
     167 
    168168            // Show an error page on creation failure 
    169169            if (!$this->_request_data['master_event']->create()) 
     
    172172                // This will exit 
    173173            } 
    174              
     174 
    175175            $this->_topic->set_parameter('cc.kaktus.exhibitions', 'master_event', $this->_request_data['master_event']->guid); 
    176176            return true; 
    177177        } 
    178          
     178 
    179179        $this->_request_data['master_event'] = new midcom_db_event($this->_config->get('master_event')); 
    180180        return true; 
    181181    } 
    182      
     182 
    183183    /** 
    184184     * Set the common items for toolbar 
    185      *  
     185     * 
    186186     * @access private 
    187187     */ 
     
    203203            ); 
    204204        } 
    205          
     205 
    206206        // Component configuration 
    207207        if (   $this->_topic->can_do('midgard:update') 
     
    220220        } 
    221221    } 
    222      
     222 
    223223    /** 
    224224     * Load the schemadb and populate common toolbar items 
    225      *  
     225     * 
    226226     * @access public 
    227227     * @return boolean Indicating success 
     
    231231        // Load schema database 
    232232        $this->_request_data['schemadb'] = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb')); 
    233          
     233 
    234234        // Populate the toolbar 
    235235        $this->_populate_toolbar(); 
    236          
     236 
    237237        return true; 
    238238    } 
    239      
     239 
    240240    /** 
    241241     * Determine the return page after editing 
    242      *  
    243      * @access static public 
     242     * 
     243     * @access public 
     244     * @static 
    244245     */ 
    245246    static public function determine_return_page($guid, $layout = null) 
    246247    { 
    247248        $event = new midcom_db_event($guid); 
    248          
     249 
    249250        if (is_null($layout)) 
    250251        { 
    251252            $layout = $event->get_parameter('midcom.helper.datamanager2', 'schema_name'); 
    252253        } 
    253          
     254 
    254255        switch ($layout) 
    255256        { 
     
    257258                $parent = new midcom_db_event($event->up); 
    258259                return date('Y', $parent->start) . "/{$parent->extra}/{$event->extra}/"; 
    259              
     260 
    260261            case 'attachment': 
    261262                $parent = new midcom_db_event($event->up); 
    262263                return date('Y', $parent->start) . "/{$parent->extra}/"; 
    263                  
     264 
    264265            case 'exhibition': 
    265266                return date('Y', $event->start) . "/{$event->extra}/"; 
    266                  
     267 
    267268            default: 
    268269                return ''; 
    269270        } 
    270          
     271 
    271272        return ''; 
    272273    } 
    273      
     274 
    274275    /** 
    275276     * Generate a URL name 
    276      *  
    277      * @access static public 
     277     * 
     278     * @access public 
     279     * @static 
    278280     * @return String 
    279281     */ 
     
    281283    { 
    282284        $title = utf8_decode($title); 
    283          
     285 
    284286        // Hand set the accent characters 
    285287        $accents = array 
     
    333335            'ÿ' => 'y', 
    334336        ); 
    335          
     337 
    336338        foreach ($accents as $accent => $ascii) 
    337339        { 
    338340            $title = str_replace($accent, $ascii, $title); 
    339341        } 
    340          
     342 
    341343        $title = strtolower($title); 
    342          
     344 
    343345        $string = ''; 
    344          
     346 
    345347        // Check each character for non-allowed characters 
    346348        for ($i = 0; $i < strlen($title); $i++) 
    347349        { 
    348350            $char = substr($title, $i, 1); 
    349              
     351 
    350352            if (!ereg('[a-zA-Z0-9\-_]', $char)) 
    351353            { 
     
    357359            } 
    358360        } 
    359          
     361 
    360362        return $string; 
    361363    } 
    362      
     364 
    363365    static public function get_image_size($string) 
    364366    { 
    365367        $attachment = null; 
    366          
     368 
    367369        if (mgd_is_guid($string)) 
    368370        { 
     
    377379            $attachment = new midcom_baseclasses_database_attachment($regs[1]); 
    378380        } 
    379          
     381 
    380382        if (   !$attachment 
    381383            || !isset($attachment->guid) 
     
    388390            ); 
    389391        } 
    390          
     392 
    391393        $size = array (); 
    392394        $size['x'] = $attachment->get_parameter('midcom.helper.datamanager2.type.blobs', 'size_x'); 
    393395        $size['y'] = $attachment->get_parameter('midcom.helper.datamanager2.type.blobs', 'size_y'); 
    394          
     396 
    395397        return $size; 
    396398    } 
  • trunk/midcom/cc.kaktus.todo/handler/list.php

    r4551 r14082  
    11<?php 
     2/** 
     3* @package cc.kaktus.todo 
     4* @author The Midgard Project, http://www.midgard-project.org 
     5* @copyright The Midgard Project, http://www.midgard-project.org 
     6* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 
     7*/ 
     8 
    29class cc_kaktus_todo_handler_list extends midcom_baseclasses_components_handler 
    310{ 
    411    /** 
    512     * TODO list item 
    6      *  
     13     * 
    714     * @access private 
    815     * @var cc_kaktus_todo_item 
    916     */ 
    1017    var $_todo = null; 
    11      
     18 
    1219    /** 
    1320     * DM2 instance for a TODO item 
    14      *  
     21     * 
    1522     * @access private 
    1623     */ 
    1724    var $_datamanager = null; 
    18      
     25 
    1926    /** 
    2027     * Parent ID of the requested TODO branch 
    21      *  
     28     * 
    2229     * @access private 
    2330     * @var integer 
    2431     */ 
    2532    var $_parent_id = null; 
    26      
     33 
    2734    /** 
    2835     * ID of the filtering person 
    29      *  
     36     * 
    3037     * @access private 
    3138     * @var integer 
    3239     */ 
    3340    var $_person_id = null; 
    34      
     41 
    3542    /** 
    3643     * Type for filtering the results 
    37      *  
     44     * 
    3845     * @access private 
    3946     * @var string 
    4047     */ 
    4148    var $_type = ''; 
    42      
     49 
    4350    /** 
    4451     * Simple constructor. Connect to the parent class. 
    45      *  
     52     * 
    4653     * @access public 
    4754     */ 
     
    5057        parent::midcom_baseclasses_components_handler(); 
    5158    } 
    52      
     59 
    5360    /** 
    5461     * 
     
    6168        $this->_schemadb =& $this->_request_data['schemadb']; 
    6269    } 
    63      
     70 
    6471    /** 
    6572     * Loads the DM instance for a TODO list item 
    66      *  
     73     * 
    6774     * @access private 
    6875     */ 
     
    7178        $this->_datamanager = new midcom_helper_datamanager2_datamanager($this->_schemadb); 
    7279        $this->_request_data['datamanager'] =& $this->_datamanager(); 
    73          
     80 
    7481        if (   !$this->_datamanager 
    7582            || !$this->_datamanager->autoset_storage($this->_team)) 
     
    7986        } 
    8087    } 
    81      
     88 
    8289    /** 
    8390     * Get the filtering options for the query builder 
    84      *  
     91     * 
    8592     * @access private 
    8693     */ 
     
    8895    { 
    8996        $filters = array (); 
    90          
     97 
    9198        // Filtering by group 
    9299        if ($this->_config->get('group')) 
     
    98105            ); 
    99106        } 
    100          
     107 
    101108        if (array_key_exists('group', $_GET)) 
    102109        { 
     
    107114            ); 
    108115        } 
    109          
     116 
    110117        // Filtering by person 
    111118        if ($this->_config->get('person')) 
     
    117124            ); 
    118125        } 
    119          
     126 
    120127        if (array_key_exists('person', $_GET)) 
    121128        { 
     
    126133            ); 
    127134        } 
    128          
     135 
    129136        if ($this->_type === 'overtime') 
    130137        { 
     
    134141                'value' => date('Y-m-d'), 
    135142            ); 
    136              
     143 
    137144            $filters['flag'] = array 
    138145            ( 
     
    141148            ); 
    142149        } 
    143          
     150 
    144151        if ($this->_type === 'finished') 
    145152        { 
     
    150157            ); 
    151158        } 
    152          
     159 
    153160        return $filters; 
    154161    } 
    155      
     162 
    156163    /** 
    157164     * Loads a list of items 
    158      *  
     165     * 
    159166     * @access private 
    160167     * @var integer Describing the owner item 
     
    163170    { 
    164171        $qb = cc_kaktus_todo_item_dba::new_query_builder(); 
    165          
     172 
    166173        if (!is_null($id)) 
    167174        { 
     
    172179            $qb->add_constraint('up', '=', 0); 
    173180        } 
    174          
     181 
    175182        if ($this->_config->get('person')) 
    176183        { 
    177184            $qb->add_constraint('pid', '=', $this->_config->get('person')); 
    178185        } 
    179          
     186 
    180187        foreach ($this->_get_filters() as $key => $array) 
    181188        { 
    182189            $qb->add_constraint($key, $array['type'], $array['value']); 
    183190        } 
    184          
     191 
    185192        return @$qb->execute_unchecked(); 
    186193    } 
    187      
     194 
    188195    /** 
    189196     * List items 
    190      *  
     197     * 
    191198     * @access private 
    192199     */ 
     
    195202        return true; 
    196203    } 
    197      
     204 
    198205    /** 
    199206     * Show TODO items 
    200      *  
     207     * 
    201208     * @access private 
    202209     */ 
     
    205212        midcom_show_style('todo_list_header'); 
    206213        $this->_items = $this->_load_items($this->_parent_id); 
    207          
     214 
    208215        foreach ($this->_items as $item) 
    209216        { 
     
    212219            midcom_show_style('todo_list_item'); 
    213220        } 
    214          
     221 
    215222        midcom_show_style('todo_list_footer'); 
    216223    } 
    217      
     224 
    218225    /** 
    219226     * List items that should have already been ready 
    220      *  
     227     * 
    221228     * @access private 
    222229     */ 
     
    226233        return true; 
    227234    } 
    228      
     235 
    229236    /** 
    230237     * Show TODO items 
    231      *  
     238     * 
    232239     * @access private 
    233240     */ 
     
    238245        midcom_show_style('todo_list_footer'); 
    239246    } 
    240      
     247 
    241248    /** 
    242249     * List items that should have already been ready 
    243      *  
     250     * 
    244251     * @access private 
    245252     */ 
     
    249256        return true; 
    250257    } 
    251      
     258 
    252259    /** 
    253260     * Show TODO items 
    254      *  
     261     * 
    255262     * @access private 
    256263     */ 
  • trunk/midcom/cc.kaktus.todo/handler/new.php

    r4551 r14082  
    11<?php 
     2/** 
     3* @package cc.kaktus.todo 
     4* @author The Midgard Project, http://www.midgard-project.org 
     5* @copyright The Midgard Project, http://www.midgard-project.org 
     6* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 
     7*/ 
     8 
    29class cc_kaktus_todo_handler_new extends midcom_baseclasses_components_handler 
    310{ 
    411    /** 
    512     * TODO list item 
    6      *  
     13     * 
    714     * @access private 
    815     * @var cc_kaktus_todo_item 
    916     */ 
    1017    var $_todo = null; 
    11      
     18 
    1219    /** 
    1320     * DM2 instance for a TODO item 
    14      *  
     21     * 
    1522     * @access private 
    1623     */ 
    1724    var $_datamanager = null; 
    18      
     25 
    1926    /** 
    2027     * DM2 instance for creating a new instance 
    21      *  
     28     * 
    2229     * @access private 
    2330     */ 
    2431    var $_controller = null; 
    25      
     32 
    2633    /** 
    2734     * Parent ID of the requested TODO branch 
    28      *  
     35     * 
    2936     * @access private 
    3037     * @var integer 
    3138     */ 
    3239    var $_parent_id = 0; 
    33      
     40 
    3441    /** 
    3542     * Simple constructor. Connect to the parent class. 
    36      *  
     43     * 
    3744     * @access public 
    3845     */ 
     
    4148        parent::midcom_baseclasses_components_handler(); 
    4249    } 
    43      
     50 
    4451    /** 
    4552     * Initialize the schemas et al. 
    46      *  
     53     * 
    4754     * @access private 
    4855     */ 
     
    5158        $this->_schemadb =& $this->_request_data['schemadb']; 
    5259    } 
    53      
     60 
    5461    /** 
    5562     * Set the defaults for the create controller 
    56      *  
     63     * 
    5764     * @access private 
    5865     */ 
     
    6168        // Initialize the array 
    6269        $defaults = array (); 
    63          
     70 
    6471        // Set the default user ID 
    6572        if ($_MIDGARD['user']) 
     
    6774            $defaults['pid'] = $_MIDGARD['user']; 
    6875        } 
    69          
     76 
    7077        // Set the root TODO item 
    7178        $defaults['up'] = $this->_parent_id; 
    7279        $defaults['deadline'] = date('Y-m-d').' 00:00:00'; 
    73          
     80 
    7481        return $defaults; 
    7582    } 
    76      
     83 
    7784    /** 
    7885     * Load the Datamanager controller instance 
    79      *  
     86     * 
    8087     * @access private 
    8188     */ 
     
    8794        $this->_request_data['controller']->defaults = $this->_set_defaults(); 
    8895        $this->_request_data['controller']->callback_object =& $this; 
    89          
     96 
    9097        if (!$this->_request_data['controller']->initialize()) 
    9198        { 
     
    94101        } 
    95102    } 
    96      
     103 
    97104    /** 
    98105     * DM2 Create callback method ties the created context to the submitted form and 
    99106     * adds the details not submitted by the form. 
    100      *  
     107     * 
    101108     * @access private 
    102109     * @return Object midcom_db_event containing the information of the created event 
     
    105112    { 
    106113        $this->_item = new cc_kaktus_todo_item_dba(); 
    107          
     114 
    108115        $this->_item->up = $this->_parent_id; 
    109116        $this->_item->topic = $this->_topic->id; 
    110          
     117 
    111118        if (!$this->_item->create()) 
    112119        { 
     
    118125            // This will exit. 
    119126        } 
    120          
     127 
    121128        return $this->_event; 
    122129    } 
    123      
     130 
    124131    /** 
    125132     * Handler for creation of a new TODO list item. Checks the permissions and initializes 
    126133     * DM2 controller scripts. 
    127      *  
     134     * 
    128135     * @access private 
    129136     */ 
     
    131138    { 
    132139        $this->_topic->require_do('midgard:create'); 
    133          
     140 
    134141        if (array_key_exists(0, $args)) 
    135142        { 
    136143            $this->_parent_id = $args[0]; 
    137144        } 
    138          
     145 
    139146        $this->_load_create_controller(); 
    140          
     147 
    141148        switch ($this->_request_data['controller']->process_form()) 
    142149        { 
     
    145152                // This will exit 
    146153                break; 
    147                  
     154 
    148155            case 'cancel': 
    149156                $_MIDCOM->relocate($this->_parent_id.'/'); 
     
    151158                // This will exit 
    152159        } 
    153          
     160 
    154161        return true; 
    155162    } 
    156      
     163 
    157164    /** 
    158165     * Show the creation form 
    159      *  
     166     * 
    160167     * @access private 
    161168     */ 
  • trunk/midcom/com.magnettechnologies.contactgrabber/lib/yahoo/class.GrabYahoo.php

    r12001