Changeset 14085

Show
Ignore:
Timestamp:
12/22/07 13:33:15 (10 months ago)
Author:
flack
Message:

phpdoc fixes 2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/cc.kaktus.pearserver/admin.php

    r14084 r14085  
    1313 * Dummy class stub. 
    1414 * 
    15  * @package cc.kaktus_pearserver 
     15 * @package cc.kaktus.pearserver 
    1616 */ 
    1717class cc_kaktus_pearserver_admin extends midcom_baseclasses_components_request_admin 
  • trunk/midcom/cc.kaktus.todo/handler/list.php

    r14082 r14085  
    77*/ 
    88 
     9/** 
     10 * @package cc.kaktus.todo 
     11 */ 
    912class cc_kaktus_todo_handler_list extends midcom_baseclasses_components_handler 
    1013{ 
  • trunk/midcom/cc.kaktus.todo/handler/new.php

    r14082 r14085  
    77*/ 
    88 
     9/** 
     10 * @package cc.kaktus.todo 
     11 */ 
    912class cc_kaktus_todo_handler_new extends midcom_baseclasses_components_handler 
    1013{ 
  • trunk/midcom/com.magnettechnologies.contactgrabber/config.php

    r11454 r14085  
    11<?php 
     2/** 
     3 * @package com.magnettechnologies.contactgrabber 
     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 */ 
    28 
    39/** 
     
    612  * Released 9th May, 2007 
    713  * Author: Magnet Technologies, vishal.kothari@magnettechnologies.com 
    8   * Credits: Janak Prajapati, Pravin Shukla, Tapan Moharana  
     14  * Credits: Janak Prajapati, Pravin Shukla, Tapan Moharana 
    915  * Copyright (C) 2007 
    1016 
     
    2632// Write full path to this istallation directory 
    2733// example: '/home/user/public_html/contacts' (linux) 
    28 //          
     34// 
    2935//$DIR_PATH = "/home/uploads/public_html/contacts"; 
    3036$DIR_PATH = ""; 
     
    3238// Write the path of curl installation 
    3339// example: '/usr/local/bin/curl' (linux) 
    34 //        
     40// 
    3541//$CURL_PATH = "/usr/local/bin/curl"; 
    3642$CURL_PATH = "/usr/bin/curl"; 
  • trunk/midcom/com.magnettechnologies.contactgrabber/contactgrabber.php

    r12534 r14085  
    11<?php 
    2  
    32/** 
    4     * This is some kind of a wrapper for the contactcrabber. 
    5     */ 
     3 * This is some kind of a wrapper for the contactcrabber. 
     4 * 
     5 * @package com.magnettechnologies.contactgrabber 
     6 * @author The Midgard Project, http://www.midgard-project.org 
     7 * @copyright The Midgard Project, http://www.midgard-project.org 
     8 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 
     9 */ 
    610 
    711/** 
    8     * Contact Grabber  
     12    * Contact Grabber 
    913    * Version 0.3 
    1014    * Released 9th May, 2007 
     
    2630    * along with this program; if not, write to the Free Software 
    2731    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
     32    * 
     33    * @package com.magnettechnologies.contactgrabber 
    2834    **/ 
    29  
    30  
    3135class com_magnettechnologies_contactgrabber extends midcom_baseclasses_components_purecode 
    3236{ 
     
    6165        if(   isset($_POST['domain']) 
    6266           && isset($_POST['username']) 
    63            && isset($_POST['password']))  
     67           && isset($_POST['password'])) 
    6468        { 
    6569            if($_POST['domain']=="rediff.com") 
     
    6771                require("lib/rediff/grabRediff.class.php"); 
    6872                $this->_email = $_POST['username']; 
    69                 $this->_resource_obj = new rediff();            
     73                $this->_resource_obj = new rediff(); 
    7074            } 
    7175 
     
    140144    { 
    141145        midcom_show_style('search-form'); 
    142          
     146 
    143147        /* 
    144148            <li class="ay" id="itab_item_yahoo"><a href="#invite_yahoo"></a></li> 
    145149            --- 
    146             <li class="ay" id="itab_item_myspace"><a href="#invite_myspace"></a></li>             
     150            <li class="ay" id="itab_item_myspace"><a href="#invite_myspace"></a></li> 
    147151            <li class="ay" id="itab_item_hotmail"><a href="#invite_hotmail"></a></li> 
    148152            ---- 
    149              
     153 
    150154            <div class="tabs_content" id="invite_yahoo"> 
    151155                <h2>Invite your Yahoo friends</h2> 
     
    182186                    <?php echo $_MIDCOM->i18n->get_string('no details are stored', 'com.magnettechnologies.contactgrabber'); ?> 
    183187                </div> 
    184             </div>           
     188            </div> 
    185189            <div class="tabs_content" id="invite_hotmail" style="display: none;"> 
    186190                <h2>Invite your Hotmail friends</h2> 
  • trunk/midcom/de.linkm.fontrenderer/main.php

    r13424 r14085  
    11<?php 
    2  
     2/** 
     3 * @package de.linkm.fontrenderer 
     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 
     9/** 
     10 * @package de.linkm.fontrenderer 
     11 */ 
    312class de_linkm_fontrenderer { 
    413 
     
    2130    var $_cache_prefix; 
    2231    var $_serial; 
    23      
     32 
    2433    function de_linkm_fontrenderer ($config = null) { 
    2534        debug_push("fontrenderer::constructor"); 
    26          
     35 
    2736        if (is_null($config) ) { 
    2837            debug_add("Default Constructor is not allowed. Aborting", MIDCOM_LOG_ERROR); 
     
    3241            return false; 
    3342        } 
    34          
     43 
    3544        $this->_font = imagepsloadfont ($config["font-file"]); 
    3645        if ($this->_font === false) { 
     
    4150            return false; 
    4251        } 
    43          
     52 
    4453        if (! is_null($config["encoding-file"])) 
    4554            imagepsencodefont ($this->_font, $config["encoding-file"]); 
    46          
     55 
    4756        $this->fontsize = intval($config["font-size"]); 
    48          
     57 
    4958        // Transform the font metrics to real pixel values 
    5059        $this->bbox_left = intval(round($config["bbox-left"] * $this->fontsize / 1000)); 
     
    5261        $this->bbox_below = intval(round($config["bbox-below"] * $this->fontsize / 1000)); 
    5362        $this->lineheight = abs($this->bbox_above) + abs($this->bbox_below); 
    54          
     63 
    5564        $this->first_indent = intval($config["first-indent"]); 
    5665        $this->left_indent = intval($config["left-indent"]); 
    5766        $this->_max_width = intval($config["max-width"]); 
    58          
     67 
    5968        $this->_hard_wrap = $config["hard-wrap"]; 
    60          
     69 
    6170        if (! mgd_snippet_exists ("/sitegroup-config/de.linkm.fontrenderer/" . $config["render-code"])) { 
    62             debug_add("Render Code Snippet \"/sitegroup-config/de.linkm.fontrenderer/{$config['render-code']}\" "  
     71            debug_add("Render Code Snippet \"/sitegroup-config/de.linkm.fontrenderer/{$config['render-code']}\" " 
    6372                      . "does not exists. Aborting", 
    6473                      MIDCOM_LOG_ERROR); 
     
    6877            return false; 
    6978        } 
    70          
     79 
    7180        $tmp = mgd_get_snippet_by_path("/sitegroup-config/de.linkm.fontrenderer/" . $config["render-code"]); 
    7281        $this->_render_code = $tmp->code; 
    73          
     82 
    7483        debug_print_r("Render Code loaded:", $this->_render_code, MIDCOM_LOG_DEBUG); 
    75          
     84 
    7685        if (! array_key_exists("cache-dir", $config)) { 
    7786            debug_add("Setting Cache to default", MIDCOM_LOG_DEBUG); 
     
    93102            return false; 
    94103        } 
    95          
     104 
    96105        debug_add("Executing: " . 'mkdir -p ' . escapeshellarg($this->_cache_dir), MIDCOM_LOG_DEBUG); 
    97106        exec('mkdir -p ' . escapeshellarg($this->_cache_dir)); 
    98          
     107 
    99108        $this->_serial = strtotime($config["serial"]); 
    100109        if ($this->_serial == -1) { 
     
    105114            return false; 
    106115        } 
    107          
     116 
    108117        $this->_text = null; 
    109118        $this->_lines = null; 
     
    111120        debug_pop(); 
    112121    } 
    113      
     122 
    114123    function _set_text ($text) { 
    115124        debug_push("fontrenderer::set_text"); 
    116          
     125 
    117126        $this->_lines = Array(); 
    118127        $this->bbox = null; 
    119128        $this->_text = trim($text); 
    120          
     129 
    121130        debug_add("We have to render \"" . $this->_text . "\"", MIDCOM_LOG_DEBUG); 
    122          
     131 
    123132        // Here we should wrap the text using the given rules 
    124133        // and return a bounding box in like imagepsbbox does. 
     
    126135        //   x/y delta coordinate for each line where the text rendering starts 
    127136        //   the string to paint there 
    128         //   other data like its width and the original boundingbox  
    129          
     137        //   other data like its width and the original boundingbox 
     138 
    130139        $remaining = $text; 
    131140        $line = 0; 
    132          
     141 
    133142        while ($remaining != "") { 
    134143            debug_add("We are now looking at line $line", MIDCOM_LOG_DEBUG); 
    135              
     144 
    136145            $available = $this->_max_width - $this->left_indent; 
    137146            if ($line == 0) 
    138147                $available -= $this->first_indent; 
    139              
     148 
    140149            debug_add("Available space = $available", MIDCOM_LOG_DEBUG); 
    141              
     150 
    142151            $current = $remaining; 
    143152            $newremaining = ""; 
    144153            $linecomplete = false; 
    145              
     154 
    146155            do { 
    147156                // Calculate width of the string, note that the "+2" is due to possible 
    148157                // off-by-one values of imagepsbbox. 
    149                  
     158 
    150159                $box = imagepsbbox($current, $this->_font, $this->fontsize, 0,0,0); 
    151160                $width = $box[2] - $box[0] + 2; 
    152161                debug_add("The remaining string would be $width pixels long", MIDCOM_LOG_DEBUG); 
    153                  
     162 
    154163                if ($width < $available) { 
    155164                    debug_add("Which means that it fits into the available width", MIDCOM_LOG_DEBUG); 
    156                      
     165 
    157166                    $this->_lines[$line]["string"] = $current; 
    158167                    $this->_lines[$line]["dx"] = $this->left_indent; 
     
    160169                    $this->_lines[$line]["bbox"] = $box; 
    161170                    $this->_lines[$line]["width"] = $width; 
    162                      
     171 
    163172                    if ($line == 0) 
    164173                        $this->_lines[$line]["dx"] += $this->first_indent; 
    165                      
     174 
    166175                    $remaining = trim($newremaining); 
    167176                    $line++; 
    168177                    $linecomplete = true; 
    169                      
     178 
    170179                } else { 
    171180                    debug_add("Which is too wide, so we'll have to compute a possible linebreak.", MIDCOM_LOG_DEBUG); 
    172                      
     181 
    173182                    $space = strrpos ($current, " "); 
    174183                    $minus = strrpos ($current, "-"); 
    175                      
     184 
    176185                    debug_add("RAW indexes: space = $space -- minus = $minus", MIDCOM_LOG_DEBUG); 
    177                      
    178                     // Ignore Matches to the last character of the string!  
    179                     // The following logic will move one character to the left so  
     186 
     187                    // Ignore Matches to the last character of the string! 
     188                    // The following logic will move one character to the left so 
    180189                    // setting it to false should be safe. 
    181                      
     190 
    182191                    if ($space == (strlen($current) - 1)) 
    183192                        $space = false; 
    184193                    if ($minus == (strlen($current) - 1)) 
    185194                        $minus = false; 
    186                      
     195 
    187196                    debug_add("cleaned indexes: space = $space -- minus = $minus", MIDCOM_LOG_DEBUG); 
    188                      
     197 
    189198                    if ($space === false and $minus === false) { 
    190199                        if (! $this->_hard_wrap) { 
     
    200209                    else if ($space > $minus) 
    201210                        $break = $space-1; // There was a space at $space and a minus at $minus, decided for $break 
    202                     else  
     211                    else 
    203212                        $break = $minus; // There was a space at $space and a minus at $minus, decided for $break 
    204                      
     213 
    205214                    // Now $break should point to the last character that is part of 
    206215                    // the current line, everything behind it is the new line. 
    207216                    // So we build these strings 
    208                      
     217 
    209218                    $newremaining = substr($current, $break+1) . $newremaining; 
    210219                    $current = substr($current, 0, $break+1); 
    211                      
     220 
    212221                    // current string we test is now $current, new remaining string stored is $newremaining 
    213                      
     222 
    214223                } // if - else (width > available) 
    215                  
     224 
    216225            } while (! $linecomplete); 
    217              
    218              
     226 
     227 
    219228        } // while remaining != "" 
    220          
     229 
    221230        // Now we make a litte sanity check: 
    222231        if (count($this->_lines) == 0) { 
     
    225234            return null; 
    226235        } 
    227          
     236 
    228237        ksort($this->_lines, SORT_NUMERIC); 
    229238        $this->linecount = count($this->_lines); 
    230          
     239 
    231240        debug_print_r("We ended up with these " . $this->linecount . " lines:",$this->_lines, MIDCOM_LOG_DEBUG); 
    232          
     241 
    233242        // The last step we have to do is to compute the real bounding box around 
    234243        // the (hypothetical) text base location. This will take any indents into 
     
    241250        // 
    242251        // We do the same thing for the right side 
    243          
     252 
    244253        $x1_corr = min($this->left_indent, 0); 
    245          
     254 
    246255        $x1 = $this->_lines[0]["bbox"][0] + min(($this->first_indent + $this->left_indent), 0); 
    247256        $x2 = $this->_lines[0]["bbox"][2] + $this->_lines[0]["dx"]; 
    248          
     257 
    249258        debug_add("Scanning for bounding box, x1_corr = $x1_corr, initial x1, x2 = $x1, $x2", MIDCOM_LOG_DEBUG); 
    250          
     259 
    251260        foreach ($this->_lines as $line => $data) { 
    252261            if ($line == 0) 
    253262                continue; 
    254                  
     263 
    255264            if (($data["bbox"][0] + $x1_corr) < $x1) 
    256265                $x1 = $data["bbox"][0] + $x1_corr; 
    257              
     266 
    258267            if (($data["bbox"][2] + $data["dx"]) > $x2) 
    259268                $x2 = $data["bbox"][2] + $data["dx"]; 
    260              
    261         } 
    262          
     269 
     270        } 
     271 
    263272        // The lower and upper boundaries are easier: 
    264          
     273 
    265274        $lastline = $this->_lines[count($this->_lines)-1]; 
    266275        $y1 = (-1 * $lastline["dy"]) + $lastline["bbox"][1]; 
    267276        $y2 = $this->_lines[0]["bbox"][3]; 
    268          
     277 
    269278        $this->bbox = Array($x1,$y1,$x2,$y2); 
    270          
     279 
    271280        debug_add("Now we are finished: x1/y1 = $x1/$y1, x2/$y2 = $x2/$y2", MIDCOM_LOG_DEBUG); 
    272281        debug_pop(); 
    273282        return $this->bbox; 
    274283    } 
    275      
     284 
    276285    function draw_text ($image, $x, $y, $col_fg, $col_bg) { 
    277286        foreach ($this->_lines as $line => $data) 
    278287            imagepstext($image, $data["string"], $this->_font, $this->fontsize, $col_fg, $col_bg, intval($x+$data["dx"]), intval($y+$data["dy"]), 0, 0, 0, 16); 
    279288    } 
    280      
     289 
    281290    function _create_image () { 
    282291        debug_push("fontrenderer::_create_image"); 
    283292        $image = null; 
    284          
     293 
    285294        debug_push("fontrenderer::_create_image::RENDER_CODE"); 
    286295        eval($this->_render_code); 
    287296        debug_pop(); 
    288          
     297 
    289298        if (is_null($image)) { 
    290299            debug_add("The Render-Code did not populate $image. Aborting!", MIDCOM_LOG_ERROR); 
     
    292301            return false; 
    293302        } 
    294          
     303 
    295304        $filename = $this->_cache_dir . md5($this->_text) . ".png"; 
    296305        debug_add("Filename: $filename"); 
    297          
     306 
    298307        if (file_exists($filename)) 
    299308            if (!unlink($filename)) { 
     
    302311                return false; 
    303312            } 
    304          
     313 
    305314        debug_add("Writing image", MIDCOM_LOG_DEBUG); 
    306315        imagepng ($image, $filename); 
    307          
     316 
    308317        if (!file_exists($filename)) { 
    309318            debug_add("Something (look for PHP messages) went wrong when writing the image. Aborting", MIDCOM_LOG_ERROR); 
     
    311320            return false; 
    312321        } 
    313          
     322 
    314323        debug_pop(); 
    315324        return true; 
    316325    } 
    317      
     326 
    318327    function get_image ($string) { 
    319328        debug_push("fontrenderer::get_image"); 
    320          
     329 
    321330        $file = md5(trim($string)) . ".png"; 
    322331        $filename = $this->_cache_dir . $file; 
    323          
     332 
    324333        debug_add("We should retrieve an image for the string \"" . trim($string) . "\" whose filename should be \"$filename\"", MIDCOM_LOG_INFO); 
    325          
     334 
    326335        $generate = false; 
    327          
     336 
    328337        if (!file_exists($filename)) { 
    329338            $generate = true; 
     
    336345            } 
    337346        } 
    338          
     347 
    339348        if ($generate) { 
    340349            if (is_null($this->_set_text($string))) { 
     
    350359            debug_add("File created successfully", MIDCOM_LOG_INFO); 
    351360        } 
    352          
     361 
    353362        $info = getimagesize($filename); 
    354          
     363 
    355364        if ($info === false || $info[2] != 3) { 
    356365            debug_add("This does not look like a PNG Image, getimagesize returned this:", $info, MIDCOM_LOG_ERROR); 
     
    358367            return false; 
    359368        } 
    360          
     369 
    361370        $result = Array(); 
    362371        $result["url"] = $this->_cache_prefix . $file; 
     
    364373        $result["size_y"] = $info[1]; 
    365374        $result["size_line"] = $info[3]; 
    366          
     375 
    367376        debug_print_r("Cache Hit. Returning this:", $result, MIDCOM_LOG_DEBUG); 
    368          
     377 
    369378        debug_pop(); 
    370379        return $result; 
    371380    } 
    372      
     381 
    373382} 
    374383 
  • trunk/midcom/de.linkm.fontrenderer/midcom/interfaces.php

    r697 r14085  
    22/** 
    33 * @package de.linkm.fontrenderer 
    4  * @author The Midgard Project, http://www.midgard-project.org  
     4 * @author The Midgard Project, http://www.midgard-project.org 
    55 * @version $Id$ 
    66 * @copyright The Midgard Project, http://www.midgard-project.org 
     
    1010/** 
    1111 * fontrenderer MidCOM interface class. 
    12  *  
     12 * 
    1313 * @package de.linkm.fontrenderer 
    14   */ 
     14 */ 
    1515class de_linkm_fontrenderer_interface extends midcom_baseclasses_components_interface 
    1616{ 
    1717    /** 
    1818     * Constructor. 
    19      *  
     19     * 
    2020     * Nothing fancy, loads all script files. 
    2121     */ 
     
    2323    { 
    2424        parent::midcom_baseclasses_components_interface(); 
    25         
     25 
    2626        $this->_component = 'de.linkm.fontrenderer'; 
    2727        $this->_autoload_files = Array('main.php'); 
  • trunk/midcom/fi.mik.lentopaikkakisa/admin.php

    r5568 r14085  
    11<?php 
    2  
    32/** 
    43 * @package fi.mik.lentopaikkakisa 
    5  * @author The Midgard Project, http://www.midgard-project.org  
     4 * @author The Midgard Project, http://www.midgard-project.org 
    65 * @version $Id$ 
    76 * @copyright The Midgard Project, http://www.midgard-project.org 
     
    1110/** 
    1211 * Forum AIS interface class. 
    13  *  
     12 * 
    1413 * @package fi.mik.lentopaikkakisa 
    1514 */ 
    1615class fi_mik_lentopaikkakisa_admin extends midcom_baseclasses_components_request_admin 
    1716{ 
    18     function fi_mik_lentopaikkakisa_admin($topic, $config)  
     17    function fi_mik_lentopaikkakisa_admin($topic, $config) 
    1918    { 
    2019         parent::midcom_baseclasses_components_request_admin($topic, $config); 
  • trunk/midcom/fi.mik.lentopaikkakisa/flight.php

    r6159 r14085  
    11<?php 
    22/** 
     3 * @package fi.mik.lentopaikkakisa 
     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 
     9/** 
    310 * MidCOM wrapped class for access to stored queries 
     11 * 
     12 * @package fi.mik.lentopaikkakisa 
    413 */ 
    5   
    614class fi_mik_flight_dba extends __fi_mik_flight_dba 
    715{ 
     
    1018        return parent::__fi_mik_flight_dba($id); 
    1119    } 
    12      
     20 
    1321    function get_parent_guid_uncached() 
    1422    { 
     
    2028        return null; 
    2129    } 
    22      
     30 
    2331    /** 
    2432     * Human-readable label for cases like Asgard navigation 
  • trunk/midcom/midcom.admin.folder/handler/index.php

    r14006 r14085  
    11<?php 
    22/** 
    3  * Created on 2006-Sep-Sun 
    43 * @author tarjei huse 
    54 * @package midcom.admin.folder 
    65 * @copyright The Midgard Project, http://www.midgard-project.org 
    76 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License 
    8  *  
     7 * 
    98 */ 
    109 
    11 class midcom_admin_folder_handler_index  extends midcom_baseclasses_components_handler  
     10/** 
     11 * Created on 2006-Sep-Sun 
     12 * 
     13 * @package midcom.admin.folder 
     14 */ 
     15class midcom_admin_folder_handler_index  extends midcom_baseclasses_components_handler 
    1216{ 
    1317    /* 
     
    1519     * See: http://www.midgard-project.org/api-docs/midcom/dev/midcom.baseclasses/midcom_baseclasses_components_handler.html 
    1620     */ 
    17      
     21 
    1822    /** 
    1923<