Changeset 14393

Show
Ignore:
Timestamp:
01/13/08 20:31:01 (9 months ago)
Author:
flack
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/globals.php

    r14083 r14393  
    2828 * error reporting level to something above MIDCOM_LOG_DEBUG. 
    2929 * 
    30  * @global midcom_helper_debug $GLOBALS['midcom_debugger'] 
     30 * @global midcom_debug $GLOBALS['midcom_debugger'] 
    3131 */ 
    3232$GLOBALS['midcom_debugger'] = null; 
  • trunk/midcom/midcom.core/midcom/helper/misc.php

    r14381 r14393  
    278278 * <b>Note:</b> This function is quite slow. It does everything on  a PHP level. 
    279279 * 
    280  * @param Array $array                The ID-Array to sort. 
     280 * @param Array &$array               The ID-Array to sort. 
    281281 * @param string $sortkey       The name of the member that should be sorted (prepend "reverse" for a reverse sorting). 
    282282 * @param string $object_type   The type of the object referenced by the IDs 
     
    330330 * Works with a reference array (doesn't return anything) 
    331331 * 
    332  * @param Array $array                The object-array to sort (used via reference). 
     332 * @param Array &$array               The object-array to sort (used via reference). 
    333333 * @param string $sortkey       The name of the member that should be sorted (prepend "reverse" for a reverse sorting). 
    334334 * @param int $sorting          The PHP sorting mechanism to use. 
     
    462462 * 
    463463 * @param MidgardObject $object The object at which to save the data. 
    464  * @param mixed $var                  The variable that should be saved. 
     464 * @param mixed &$var                 The variable that should be saved. 
    465465 * @param string $name                  The identifier to use for storage. 
    466466 * @return boolean Indicating success. 
     
    643643 * It is recommended to use imagemagick in favor of this function. 
    644644 * 
    645  * @param int $dst_img        Destination Image Handle. 
    646  * @param int $src_img        Source image Handle. 
     645 * @param int &$dst_img       Destination Image Handle. 
     646 * @param int &$src_img       Source image Handle. 
    647647 * @param int $dst_x    X-offest of the destination. 
    648648 * @param int $dst_y    Y-offest of the destination. 
     
    717717 * It is recommended to use imagemagick in favor of this function. 
    718718 * 
    719  * @param int $dst_img        Destination Image Handle. 
    720  * @param int $src_img        Source image Handle. 
     719 * @param int &$dst_img       Destination Image Handle. 
     720 * @param int &$src_img       Source image Handle. 
    721721 * @param int $dst_x    X-offest of the destination. 
    722722 * @param int $dst_y    Y-offest of the destination. 
  • trunk/midcom/midcom.helper.filesync/importer/snippet.php

    r13895 r14393  
    99 
    1010/** 
    11  * Export a site snippet to the format used by Site Wizard 
     11 * Import a site snippet from the format used by Site Wizard 
    1212 * 
    1313 * @package midcom.helper.filesync 
     
    1616{ 
    1717    var $root_dir = ''; 
    18      
     18 
    1919    function midcom_helper_filesync_importer_snippet() 
    2020    { 
    2121        parent::midcom_helper_filesync_importer(); 
    22          
     22 
    2323        $this->root_dir = midcom_helper_filesync_interface::prepare_dir('snippets'); 
    2424    } 
    25      
     25 
    2626    function read_snippetdir($path, $parent_id) 
    2727    { 
    2828        $snippetdir_name = basename($path); 
    29          
     29 
    3030        $object_qb = midcom_baseclasses_database_snippetdir::new_query_builder(); 
    3131        $object_qb->add_constraint('up', '=', $parent_id); 
     
    4848        } 
    4949 
    50         $directory = dir($path);         
    51         while (false !== ($entry = $directory->read()))  
     50        $directory = dir($path); 
     51        while (false !== ($entry = $directory->read())) 
    5252        { 
    5353            if (substr($entry, 0, 1) == '.') 
     
    5656                continue; 
    5757            } 
    58          
     58 
    5959            if (is_dir("{$path}/{$entry}")) 
    6060            { 
     
    6262                $this->read_snippetdir("{$path}/{$entry}", $snippetdir->id); 
    6363            } 
    64              
     64 
    6565            // Check file type 
    6666            $filename_parts = explode('.', $entry); 
     
    8484                continue; 
    8585            } 
    86                          
     86 
    8787            // Deal with element 
    8888            $file_contents = file_get_contents("{$path}/{$entry}"); 
     
    9292                $file_contents = @iconv($encoding, 'UTF-8', $file_contents); 
    9393            } 
    94              
     94 
    9595            $qb = midcom_baseclasses_database_snippet::new_query_builder(); 
    9696            $qb->add_constraint('up', '=', $snippetdir->id); 
     
    109109            $snippets = $qb->execute(); 
    110110            $snippet = $snippets[0]; 
    111              
     111 
    112112            // Update existing elements only if they have actually changed 
    113113            if ($snippet->$field != $file_contents) 
     
    119119        $directory->close(); 
    120120    } 
    121      
     121 
    122122    function read_dirs($path) 
    123123    { 
    124         $directory = dir($path);         
    125         while (false !== ($entry = $directory->read()))  
     124        $directory = dir($path); 
     125        while (false !== ($entry = $directory->read())) 
    126126        { 
    127127            if (substr($entry, 0, 1) == '.') 
     
    130130                continue; 
    131131            } 
    132          
     132 
    133133            if (is_dir("{$path}/{$entry}")) 
    134134            { 
     
    139139        $directory->close(); 
    140140    } 
    141   
     141 
    142142    function import() 
    143143    { 
  • trunk/midcom/midcom.helper.filesync/importer/style.php

    r13895 r14393  
    99 
    1010/** 
    11  * Export a site style to the format used by Site Wizard 
     11 * Import a site style from the format used by Site Wizard 
    1212 * 
    1313 * @package midcom.helper.filesync 
     
    1616{ 
    1717    var $root_dir = ''; 
    18      
     18 
    1919    function midcom_helper_filesync_importer_style() 
    2020    { 
    2121        parent::midcom_helper_filesync_importer(); 
    22          
     22 
    2323        $this->root_dir = midcom_helper_filesync_interface::prepare_dir('style'); 
    2424    } 
    25      
     25 
    2626    function read_style($path, $parent_id) 
    2727    { 
    2828        $style_name = basename($path); 
    29          
     29 
    3030        $object_qb = midcom_db_style::new_query_builder(); 
    3131        $object_qb->add_constraint('up', '=', $parent_id); 
     
    4848        } 
    4949 
    50         $directory = dir($path);         
    51         while (false !== ($entry = $directory->read()))  
     50        $directory = dir($path); 
     51        while (false !== ($entry = $directory->read())) 
    5252        { 
    5353            if (substr($entry, 0, 1) == '.') 
     
    5656                continue; 
    5757            } 
    58          
     58 
    5959            if (is_dir("{$path}/{$entry}")) 
    6060            { 
     
    6262                $this->read_style("{$path}/{$entry}", $style->id); 
    6363            } 
    64              
     64 
    6565            // Deal with element 
    66              
     66 
    6767            // Check file type 
    6868            $filename_parts = explode('.', $entry); 
     
    8383                continue; 
    8484            } 
    85              
     85 
    8686            $file_contents = file_get_contents("{$path}/{$entry}"); 
    8787            $encoding = mb_detect_encoding($file_contents); 
     
    9090                $file_contents = @iconv($encoding, 'UTF-8', $file_contents); 
    9191            } 
    92              
     92 
    9393            $qb = midcom_db_element::new_query_builder(); 
    9494            $qb->add_constraint('style', '=', $style->id); 
     
    107107            $elements = $qb->execute(); 
    108108            $element = $elements[0]; 
    109              
     109 
    110110            // Update existing elements only if they have actually changed 
    111111            if ($element->$field != $file_contents) 
     
    117117        $directory->close(); 
    118118    } 
    119      
     119 
    120120    function read_styledir($path) 
    121121    { 
    122         $directory = dir($path);         
    123         while (false !== ($entry = $directory->read()))  
     122        $directory = dir($path); 
     123        while (false !== ($entry = $directory->read())) 
    124124        { 
    125125            if (substr($entry, 0, 1) == '.') 
     
    128128                continue; 
    129129            } 
    130          
     130 
    131131            if (is_dir("{$path}/{$entry}")) 
    132132            { 
     
    137137        $directory->close(); 
    138138    } 
    139   
     139 
    140140    function import() 
    141141    {