Changeset 15234

Show
Ignore:
Timestamp:
02/25/08 11:10:31 (7 months ago)
Author:
flack
Message:

some spelling/phpdoc fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/services/indexer/backend/XMLCommClient.php

    r14773 r15234  
    33/** 
    44 * @package midcom.services 
    5  * @author The Midgard Project, http://www.midgard-project.org  
     5 * @author The Midgard Project, http://www.midgard-project.org 
    66 * @version $Id:XMLCommClient.php 3765 2006-07-31 08:51:39 +0000 (Mon, 31 Jul 2006) tarjei $ 
    77 * @copyright The Midgard Project, http://www.midgard-project.org 
     
    1212 * This class provides an interface to the MRFC 14 XML driven indexer 
    1313 * backends. 
    14  *  
     14 * 
    1515 * This class is responsible for producing an XML Request file. 
    16  *  
     16 * 
    1717 * ... 
    18  *  
     18 * 
    1919 * @package midcom.services 
    2020 * @see midcom_services_indexer 
     
    2626    /** 
    2727     * The index name to use 
    28      *  
     28     * 
    2929     * @var string 
    3030     * @access private 
    3131     */ 
    3232    var $_index_name = null; 
    33      
     33 
    3434    /** 
    3535     * The current request content. This does not include the XML header 
     
    3838     */ 
    3939    var $_request = ''; 
    40      
     40 
    4141    /** 
    4242     * Initialize an XMLComm Request Writer. 
    43      *  
     43     * 
    4444     * All double-quotes will be silently removed from the index name. 
    45      *  
     45     * 
    4646     * @param string $index_name The name of the Index to be used. If not specified, the midcom config key 'indexer_index_name' is used. 
    4747     */ 
     
    5959        $this->_index_name = $this->_encode_argument($this->_index_name); 
    6060    } 
    61      
     61 
    6262    /** 
    6363     * Surrounds the request data with an xml header and the request tags 
    6464     * and returns the result. 
    65      *  
    66      * @param boolean $mask_request Set this to true to mask all occurences of </request> in the content with 
     65     * 
     66     * @param boolean $mask_request Set this to true to mask all occurrences of </request> in the content with 
    6767     *     </request_>, which is required for the TCP backends. (PHP cannot close a TCP socket in one direction 
    6868     *     only, so EOF checks won't work. 
     
    8585        return "{$prefix}\n{$this->_request}\n{$postfix}\n"; 
    8686    } 
    87      
     87 
    8888    /** 
    8989     * Add a query to the request. 
    90      *  
     90     * 
    9191     * @param string $id The ID of the request. 
    9292     * @param string $query The query string (added as CDATA). 
     
    108108                    $start = $filter->get_start(); 
    109109                    $end = $filter->get_end(); 
    110                      
     110 
    111111                    $this->_request .= "    <datefilter field='{$field}'>\n"; 
    112112                    if ($start > 0) 
     
    122122                    $this->_request .= "    </datefilter>\n"; 
    123123                    break; 
    124                      
     124 
    125125                default: 
    126126                    $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Indexer XMLCommClient: Encountered unknown filter type {$filter->type}."); 
     
    131131        $this->_request .= "</query>\n"; 
    132132    } 
    133      
     133 
    134134    /** 
    135135     * Index one or more documents. 
    136      *  
     136     * 
    137137     * @param string $id The ID of the request. 
    138      * @param mixed $document One or more documents to be indexed, so this is either a  
     138     * @param mixed $document One or more documents to be indexed, so this is either a 
    139139     *           midcom_services_indexer_document or an Array of these objects. 
    140140     */ 
     
    150150            return; 
    151151        } 
    152          
     152 
    153153        $id = $this->_encode_argument($id); 
    154154        $this->_request .= "<index id='{$id}'>\n"; 
    155          
     155 
    156156        foreach ($documents as $document) 
    157157        { 
    158158            $RI = $this->_encode_argument($document->RI); 
    159159            $this->_request .= "  <document id='{$RI}'>\n"; 
    160              
     160 
    161161            foreach ($document->list_fields() as $field_name) 
    162162            { 
     
    166166                $this->_request .= "    <{$field['type']} name='{$field['name']}'>{$field['content']}</{$field['type']}>\n"; 
    167167            } 
    168              
     168 
    169169            $this->_request .= "  </document>\n"; 
    170170        } 
    171          
     171 
    172172        $this->_request .= "</index>\n"; 
    173173    } 
    174      
     174 
    175175    /** 
    176176     * Adds a delete request. 
    177      *  
     177     * 
    178178     * @param string $id The ID of the request. 
    179179     * @param string $RI The document's resource identifier. 
     
    185185        $this->_request .= "<delete id='{$id}' documentid='{$RI}' />\n"; 
    186186    } 
    187      
     187 
    188188    /** 
    189189     * Adds a drop index request. 
    190      *  
     190     * 
    191191     * @param string $id The ID of the request. 
    192192     */ 
     
    196196        $this->_request .= "<deleteall id='{$id}' />\n"; 
    197197    } 
    198      
    199      
     198 
     199 
    200200    // HELPERS 
    201      
     201 
    202202    /** 
    203203     * Encodes an argument masking both single and double quotes. 
    204      *  
     204     * 
    205205     * @param string $string String to modify. 
    206      * @return string The modified string.  
     206     * @return string The modified string. 
    207207     */ 
    208208    function _encode_argument($string) 
    209209    { 
    210         return str_replace(Array('"', "'"), Array('&quot;', '&apos;'), $this->_clean_content_control_chars($string));  
    211     } 
    212      
     210        return str_replace(Array('"', "'"), Array('&quot;', '&apos;'), $this->_clean_content_control_chars($string)); 
     211    } 
     212 
    213213    /** 
    214214     * Encodes a string using CDATA encoding. 
    215      *  
     215     * 
    216216     * @param string $string The original string. 
    217217     * @return string The encoded string including the CDATA tags. 
     
    223223    /** 
    224224     * Removes all control characters except LF from the content, as this might throw the indexer 
    225      * off-track (valid XML and the like).  
    226      * 
    227      * WARNING: This function could break UTF-8 sequences right now, I'm on the lookout for a  
     225     * off-track (valid XML and the like). 
     226     * 
     227     * WARNING: This function could break UTF-8 sequences right now, I'm on the lookout for a 
    228228     * better regex, as I do not know if the /u pattern modifier is enough. I just hope so. 
    229      *  
     229     * 
    230230     * @param string $string The string to process. 
    231231     * @todo Finish Regex. 
     
    242242 * This class provides an interface to the MRFC 14 XML driven indexer 
    243243 * backends. 
    244  *  
     244 * 
    245245 * This class is responsible for parsing a Respons XML file. It uses the 
    246246 * PEAR XML_Parser base class. 
    247  *  
     247 * 
    248248 * Note, that Expat does currently *not* support Input DTD validation. We trust 
    249249 * the source for now. Eventually, this might get rewritten top libXML. 
    250  *  
     250 * 
    251251 * ... 
    252  *  
     252 * 
    253253 * @package midcom.services 
    254254 * @see midcom_services_indexer 
     
    260260     * Current Data collected by the CDATA handler, will be processed by 
    261261     * the end-element handlers. 
    262      *  
     262     * 
    263263     * @access private 
    264264     * @var string 
    265265     */ 
    266266    var $_current_data = ''; 
    267      
     267 
    268268    /** 
    269269     * An array of resultsets. A resultset is an array of documents. 
    270      *  
     270     * 
    271271     * They are indexed by the request id. 
    272      *  
     272     * 
    273273     * Only valid after parsing the Request. 
    274      *  
     274     * 
    275275     * @var Array 
    276276     */ 
    277277    var $resultsets = Array(); 
    278      
     278 
    279279    /** 
    280280     * An array of warnings that have been found. 
    281      *  
     281     * 
    282282     * They are indexed by the request id. 
    283      *  
     283     * 
    284284     * Only valid after parsing the Request. 
    285      *  
     285     * 
    286286     * @var Array 
    287287     */ 
    288288    var $warnings = Array(); 
    289      
     289 
    290290    /** 
    291291     * The current document, before being added to the resultset. 
    292      *  
     292     * 
    293293     * @access private 
    294294     * @var midcom_services_indexer_document 
    295295     */ 
    296296    var $_current_document = null; 
    297      
     297 
    298298    /** 
    299299     * The current request ID. 
    300      *  
     300     * 
    301301     * @access private 
    302302     * @var string 
    303303     */ 
    304304    var $_current_id = ''; 
    305      
     305 
    306306    /** 
    307307     * The name of the current field, which is collected in _current_data at this time. 
    308      *  
     308     * 
    309309     * @access private 
    310310     * @var string 
    311311     */ 
    312312    var $_current_field = null; 
    313      
     313 
    314314    /** 
    315315     * The RI of the document currently being parsed. 
    316      *  
     316     * 
    317317     * @access private 
    318318     * @var string 
    319319     */ 
    320320    var $_current_document_id = ''; 
    321      
    322      
     321 
     322 
    323323    /** 
    324324     * Initialize the XML Parser. 
     
    332332        parent::XML_Parser(null, 'event'); 
    333333    } 
    334      
    335      
     334 
     335 
    336336    /** 
    337337     * The character data collector. 
    338      *  
     338     * 
    339339     * This is an Expat Callback. 
    340      *  
     340     * 
    341341     * @param object $parser The XML Parser resource 
    342342     * @param string $data The read data. 
     
    347347        $this->_current_data .= $data; 
    348348    } 
    349      
     349 
    350350    /** 
    351351     * Start a new resultset. 
    352      *  
     352     * 
    353353     * This will store the resultset id, the rest of the work is done by the 
    354354     * document tag handlers. 
    355      *  
     355     * 
    356356     * @param object $parser The XML parser resource 
    357357     * @param string $name The name of the element being parsed 
     
    364364        $this->resultsets[$this->_current_id] = Array(); 
    365365    } 
    366      
     366 
    367367    /** 
    368368     * The resultset is complete. 
     
    376376        $this->_current_id = ''; 
    377377    } 
    378      
     378 
    379379    /** 
    380380     * Start a new document. 
    381      *  
     381     * 
    382382     * This will prepare a new document and save the corresponding ID. 
    383      *  
     383     * 
    384384     * @param object $parser The XML parser resource 
    385385     * @param string $name The name of the element being parsed 
     
    393393        $this->_current_document_id = $attribs['ID']; 
    394394    } 
    395     
     395 
    396396   /** 
    397397     * The document is complete. 
     
    408408        $this->_current_document_id = ''; 
    409409    } 
    410     
     410 
    411411    /** 
    412412     * Start a new document field. 
    413      *  
     413     * 
    414414     * @param object $parser The XML parser resource 
    415415     * @param string $name The name of the element being parsed 
     
    422422        $this->_current_data = ''; 
    423423    } 
    424      
     424 
    425425    /** 
    426426     * The field is complete. 
     
    435435        $this->_current_field = null; 
    436436    } 
    437      
     437 
    438438    /** 
    439439     * Start a new warning record. 
    440      *  
     440     * 
    441441     * @param object $parser The XML parser resource 
    442442     * @param string $name The name of the element being parsed 
     
    449449        $this->_current_data = ''; 
    450450    } 
    451     
     451 
    452452    /** 
    453453     * The warning is complete. 
     
    461461        $this->warnings[$this->_current_id] = $this->_current_data; 
    462462    } 
    463      
     463 
    464464    /** 
    465465     * Start an error record. 
    466      *  
     466     * 
    467467     * @param object $parser The XML parser resource 
    468468     * @param string $name The name of the element being parsed 
     
    475475        $this->_current_data = ''; 
    476476    } 
    477    
     477 
    478478    /** 
    479479     * The error is complete. 
    480      *  
     480     * 
    481481     * This will call generate_error with the error message, as this is a 
    482482     * rather critical error. 
     
    493493            debug_add($msg, MIDCOM_LOG_ERROR); 
    494494    } 
    495      
     495 
    496496    /** 
    497497     * This function will parse the given string. Any error from Expat 
    498498     * will trigger generate_error. 
    499      *  
     499     * 
    500500     * @param string $string The XML data to be parsed. 
    501501     */ 
     
    504504        debug_push_class(__CLASS__, __FUNCTION__); 
    505505        // Set the mode now, so that $this is a valid reference. 
    506         $this->setMode('func');  
    507          
     506        $this->setMode('func'); 
     507 
    508508        $result = parent::parseString($string, true); 
    509          
     509 
    510510        if ($result !== true) 
    511511        { 
  • trunk/midcom/midcom.core/midcom/services/permalinks.php

    r14954 r15234  
    2323 * 
    2424 * The current Permalink implementation limits granularity to a GUID level -- permalinks 
    25  * map object GUIDs to pages. If you have mulitple pages showing the same object, you need 
     25 * map object GUIDs to pages. If you have multiple pages showing the same object, you need 
    2626 * to decide which one you wish to have as permalink and provide that URL for resolution. 
    2727 * For the forward lookup, it is allowed to have multiple pages set the same permalink. 
  • trunk/midcom/midcom.helper.datamanager/datamanager.php

    r15146 r15234  
    19121912     * of the separator or one of the two newline characters \n and \r will trigger 
    19131913     * quoting. In quoting mode, the entire string will be enclosed in double-quotes. 
    1914      * Any occurence of a double quote in the original string will be transformed 
     1914     * Any occurrence of a double quote in the original string will be transformed 
    19151915     * into two double quotes. Any leading or trailing whitespace around the data 
    19161916     * will be eliminated. 
     
    19321932 
    19331933        if (preg_match($pattern, $data) != 0) { 
    1934             // Qutoed operation required: Escape quotes 
     1934            // Quoted operation required: Escape quotes 
    19351935            return '"' . str_replace('"','""',$data) . '"'; 
    19361936        } else { 
  • trunk/midcom/midcom.helper.datamanager2/csv.php

    r14385 r15234  
    7171     * of the separator or one of the two newline characters \n and \r will trigger 
    7272     * quoting. In quoting mode, the entire string will be enclosed in double-quotes. 
    73      * Any occurence of a double quote in the original string wille be transformed 
     73     * Any occurrence of a double quote in the original string will be transformed 
    7474     * into two double quotes. Any leading or trailing whitespace around the data 
    7575     * will be eliminated. 
     
    9191        if (preg_match($pattern, $string) != 0) 
    9292        { 
    93             // Qutoed operation required: Escape quotes 
     93            // Quoted operation required: Escape quotes 
    9494            return '"' . str_replace('"','""',$string) . '"'; 
    9595        } 
  • trunk/midcom/midcom.helper.datamanager2/widget.php

    r14380 r15234  
    4848 
    4949    /** 
    50      * The name field holds the name of the field the widget is encapsulating.  
    51      *  
     50     * The name field holds the name of the field the widget is encapsulating. 
     51     * 
    5252     * This maps to the schema's field name. You should never have to change them. 
    5353     * 
     
    5858 
    5959    /** 
    60      * A reference to the schema field we should draw.  
    61      *  
     60     * A reference to the schema field we should draw. 
     61     * 
    6262     * Description texts etc. are taken from here. 
    6363     * 
     
    6868 
    6969    /** 
    70      * The schema (not the schema <i>database!</i>) to use for operation.  
    71      *  
    72      * This variable will always contain a parsed representation of the schema, so that  
     70     * The schema (not the schema <i>database!</i>) to use for operation. 
     71     * 
     72     * This variable will always contain a parsed representation of the schema, so that 
    7373     * one can swiftly switch between individual schemas of the Database. 
    7474     * 
     
    8989 
    9090    /** 
    91      * This is the Namespace to use for all HTML/CSS/JS elements.  
    92      *  
    93      * It is deduced by the formmanager and tries to be as smart as possible to work safely with  
     91     * This is the Namespace to use for all HTML/CSS/JS elements. 
     92     * 
     93     * It is deduced by the formmanager and tries to be as smart as possible to work safely with 
    9494     * more then one form on a page. 
    9595     * 
    96      * You have to prefix all elements which must be unique using this string (it includes a  
     96     * You have to prefix all elements which must be unique using this string (it includes a 
    9797     * trailing underscore). 
    9898     * 
     
    128128     * @param Array $config The configuration data which should be used to customize the widget. 
    129129     * @param midcom_helper_datamanager2_schema &$schema A reference to the full schema object. 
    130      * @param midcom_helper_datamanager2_type $type A reference to the type to which we are bound. 
     130     * @param midcom_helper_datamanager2_type &$type A reference to the type to which we are bound. 
    131131     * @param string $namespace The namespace to use including the trailing underscore. 
    132132     * @param boolean $initialize_dependencies Whether to load JS and other dependencies on initialize 
     
    162162     * Set the form reference. 
    163163     * 
    164      * @param HTMLQuickForm $form The form to use. 
     164     * @param HTMLQuickForm &$form The form to use. 
    165165     */ 
    166166    function set_form(&$form) 
     
    188188 
    189189    /** 
    190      * Gets an external configuration option referenced by its key.  
    191      *  
    192      * Besides other parts in the datamanager framework, nobody should ever have to  
     190     * Gets an external configuration option referenced by its key. 
     191     * 
     192     * Besides other parts in the datamanager framework, nobody should ever have to 
    193193     * touch this information. 
    194194     * 
     
    206206 
    207207    /** 
    208      * Sets an external configuration option.  
    209      *  
    210      * Besides other parts in the datamanager framework, nobody should ever have to  
     208     * Sets an external configuration option. 
     209     * 
     210     * Besides other parts in the datamanager framework, nobody should ever have to 
    211211     * touch this information. 
    212212     * 
     
    233233 
    234234    /** 
    235      * Returns the default value for this field as required by HTML_Quickform.  
    236      *  
    237      * You may either return a single value for simple types, or an array of form  
    238      * field name / value pairs in case of composite types. A value of null indicates  
     235     * Returns the default value for this field as required by HTML_Quickform. 
     236     * 
     237     * You may either return a single value for simple types, or an array of form 
     238     * field name / value pairs in case of composite types. A value of null indicates 
    239239     * no applicable default. 
    240240     * 
     
    262262    /** 
    263263     * This function is invoked if the widget should extract the corresponding data 
    264      * from the form results passed in $results.  
    265      *  
    266      * Form validation has already been done before, this function will only be called  
     264     * from the form results passed in $results. 
     265     * 
     266     * Form validation has already been done before, this function will only be called 
    267267     * if and only if the form validation succeeds. 
    268268     * 
     
    277277    /** 
    278278     * This event handler is called if and only if the Formmanager detects an actual 
    279      * form submission (this is tracked using a hidden form member).  
    280      *  
    281      * No Form validation has been done at this point. The event is triggered on all  
     279     * form submission (this is tracked using a hidden form member). 
     280     * 
     281     * No Form validation has been done at this point. The event is triggered on all 
    282282     * submissions with the exception of the cancel and previous form events. 
    283283     * 
     
    305305 
    306306    /** 
    307      * Freezes all form elements associated with the widget.  
    308      *  
    309      * The default implementation works on the default field name, you don't need to override  
     307     * Freezes all form elements associated with the widget. 
     308     * 
     309     * The default implementation works on the default field name, you don't need to override 
    310310     * this function unless you have multiple widgets in the form. 
    311311     * 
     
    322322 
    323323    /** 
    324      * Unfreezes all form elements associated with the widget.  
    325      *  
    326      * The default implementation works on the default field name, you don't need to override  
     324     * Unfreezes all form elements associated with the widget. 
     325     * 
     326     * The default implementation works on the default field name, you don't need to override 
    327327     * this function unless you have multiple widgets in the form. 
    328328     * 
     
    336336 
    337337    /** 
    338      * Checks if the widget is frozen.  
    339      *  
    340      * The default implementation works on the default field name, usually you don't need to  
     338     * Checks if the widget is frozen. 
     339     * 
     340     * The default implementation works on the default field name, usually you don't need to 
    341341     * override this function unless you have some strange form element logic. 
    342342     * 
  • trunk/midcom/midcom.helper.datamanager2/widget/captcha.php

    r14329 r15234  
    169169 
    170170    /** 
    171      * QF Valiation callback which verifies the passcode against the Captcha. 
     171     * QF Validation callback which verifies the passcode against the Captcha. 
    172172     */ 
    173173    function validate($fields) 
  • trunk/midcom/midcom.helper.datamanager2/widget/hidden.php

    r14773 r15234  
    6969 
    7070    /** 
    71      * QF Valiation callback used for number types. It checks the number boundaries 
     71     * QF Validation callback used for number types. It checks the number boundaries 
    7272     * accordingly. 
    7373     */ 
  • trunk/midcom/midcom.helper.datamanager2/widget/image.php

    r14773 r15234  
    375375        parent::on_submit($results); 
    376376 
    377         // TODO: refator these checks to separate methods 
     377        // TODO: refactor these checks to separate methods 
    378378        if (array_key_exists("{$this->name}_delete", $results)) 
    379379        { 
  • trunk/midcom/midcom.helper.datamanager2/widget/photo.php

    r15158 r15234  
    2929    function on_submit($results) 
    3030    { 
    31         // TODO: refator these checks to separate methods 
     31        // TODO: refactor these checks to separate methods 
    3232        if (array_key_exists("{$this->name}_rotate", $results)) 
    3333        { 
  • trunk/midcom/midcom.helper.datamanager2/widget/text.php

    r14329 r15234  
    132132 
    133133    /** 
    134      * QF Valiation callback used for number types. It checks the number boundaries 
     134     * QF Validation callback used for number types. It checks the number boundaries 
    135135     * accordingly. 
    136136     */ 
  • trunk/midcom/midcom.helper.datamanager2/widget/video.php

    r14773 r15234  
    8484        ); 
    8585        $this->_upload_element_video =& HTML_QuickForm::createElement('file', "{$this->name}_file_video", '', $attributes); 
    86   
     86 
    8787        $elements = Array(); 
    8888        $elements_video = Array(); 
     
    323323                "{$size}, {$info['formattedsize']} Byte</li>\n"; 
    324324        } 
    325      
     325 
    326326        } 
    327327        $static_html .= "</ul>\n"; 
     
    378378    } 
    379379 
    380     
     380 
    381381    function _create_upload_elements_video(&$elements) 
    382382    { 
    383383        // The table 
    384384        $static_html = "<table border='0' class='midcom_helper_datamanager2_widget_image_table' id='{$this->_namespace}{$this->name}_table'>\n"; 
    385          
     385 
    386386        $elements[] =& HTML_QuickForm::createElement('static', "{$this->name}_start", '', $static_html); 
    387387 
     
    390390 
    391391    // Video info 
    392              
     392 
    393393        $elements[] =& HTML_QuickForm::createElement('static', "{$this->name}_inter2", '', $static_html); 
    394      
     394 
    395395        // The upload field 
    396396    $static_html = "<tr><td>" . $this->_l10n->get('upload file') . "</td><td>\n"; 
     
    404404        ); 
    405405        //$elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload_video", $this->_l10n->get('upload file'), $attributes); 
    406      
     406 
    407407    $static_html = "</td></tr>\n"; 
    408408 
     
    417417        // The table 
    418418        $static_html = "<table border='0' class='midcom_helper_datamanager2_widget_image_table' id='{$this->_namespace}{$this->name}_table'>\n"; 
    419          
     419 
    420420        $elements[] =& HTML_QuickForm::createElement('static', "{$this->name}_start", '', $static_html); 
    421421 
     
    424424 
    425425    // Video info 
    426              
     426 
    427427        foreach ($this->_type->attachments_info as $name => $info) 
    428428    { 
     
    436436    $static_html .= "</ul>\n"; 
    437437        $elements[] =& HTML_QuickForm::createElement('static', "{$this->name}_inter2", '', $static_html); 
    438      
     438 
    439439        // Add the Delete button 
    440440        $attributes = Array 
     
    443443        ); 
    444444        $elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_delete_video", $this->_l10n->get('delete video'), $attributes); 
    445          
     445 
    446446    // The upload field 
    447447    $static_html = "</td></tr><tr><td>" . $this->_l10n->get('upload file') . "</td><td>\n"; 
     
    455455        ); 
    456456        //$elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload_video", $this->_l10n->get('upload file'), $attributes); 
    457      
     457 
    458458    $static_html = "</td></tr>"; 
    459459 
     
    522522 
    523523    /** 
    524      * The on_submit event handles all file uploads immediately.  
    525      *  
    526      * They are passed through the type at that point. This is required, since we do not have  
     524     * The on_submit event handles all file uploads immediately. 
     525     * 
     526     * They are passed through the type at that point. This is required, since we do not have 
    527527     * persistent upload file management on the QF side. Deletions take precedence over uploads. 
    528528     */ 
     
    531531        parent::on_submit($results); 
    532532 
    533         // TODO: refator these checks to separate methods 
     533        // TODO: refactor these checks to separate methods 
    534534        if (array_key_exists("{$this->name}_delete_video", $results)) 
    535535        { 
     
    571571            } 
    572572 
    573         }    
     573        } 
    574574        else 
    575575        { 
    576576            if ($this->_upload_element_video->isUploadedFile()) 
    577577            { 
    578      
     578 
    579579                $file_video = $this->_upload_element_video->getValue(); 
    580      
     580 
    581581                //echo "<pre>"; 
    582582                //print_r($this->_upload_element_video); 
    583583                //print_r($this->_upload_element); 
    584584                //echo "</pre>"; 
    585      
     585 
    586586                if (!empty($file_video['name'])) 
    587587                { 
     
    599599                } 
    600600            } 
    601              
     601 
    602602            if ($this->_upload_element->isUploadedFile()) 
    603603            { 
    604604                $file = $this->_upload_element->getValue(); 
    605              
     605 
    606606                //echo "<pre>"; 
    607607                //print_r($this->_upload_element_video); 
    608608                //print_r($this->_upload_element); 
    609609                //echo "</pre>"; 
    610      
     610 
    611611                if ($this->show_title) 
    612612                { 
     
    617617                    $title = ''; 
    618618                } 
    619                  
     619 
    620620                if (!empty($file['name'])) 
    621621                { 
  • trunk/midcom/midcom.helper.replicator/exporter.php

    r14773 r15234  
    2222 
    2323    var $exportability = array(); 
    24      
     24 
    2525    var $handled_dependencies = array(); 
    2626 
     
    3535    { 
    3636         $this->_component = 'midcom.helper.replicator'; 
    37           
     37 
    3838         $this->subscription = $subscription; 
    39           
     39 
    4040         parent::midcom_baseclasses_components_purecode(); 
    4141    } 
    42      
     42 
    4343    /** 
    4444     * This is a static factory method which lets you dynamically create exporter instances. 
     
    5858        $type = $subscription->exporter; 
    5959        $filename = MIDCOM_ROOT . "/midcom/helper/replicator/exporter/{$type}.php"; 
    60          
     60 
    6161        if (!file_exists($filename)) 
    6262        { 
     
    6666        require_once($filename); 
    6767 
    68         $classname = "midcom_helper_replicator_exporter_{$type}";         
     68        $classname = "midcom_helper_replicator_exporter_{$type}"; 
    6969        if (!class_exists($classname)) 
    7070        { 
     
    7272            // This will exit. 
    7373        } 
    74          
     74 
    7575        /** 
    7676         * Php 4.4.1 does not allow you to return a reference to an expression. 
     
    120120        } 
    121121        unset($privileges, $privilege, $qb); 
    122          
     122 
    123123        debug_pop(); 
    124124        return $serializations; 
     
    155155            return false; 
    156156        } 
    157          
     157 
    158158        // Check that we can export parameters of the attachment as well before adding it to the serialized list 
    159159        $attachment_parameters = $this->serialize_parameters($attachment); 
     
    218218                debug_add("Attachment {$attachment->guid} is not exportable", MIDCOM_LOG_INFO); 
    219219                continue; 
    220             }         
    221          
     220            } 
     221 
    222222            $attachment_serialized = $this->serialize_attachment($attachment); 
    223223            if ($attachment_serialized === false) 
     
    271271                continue; 
    272272            } 
    273              
     273 
    274274            $parameter_serialized = midcom_helper_replicator_serialize($parameter); 
    275275            if ($parameter_serialized === false) 
     
    304304        debug_add("called for {$class} {$object->guid}"); 
    305305        $serializations = array(); 
    306         $GLOBALS['midcom_helper_replicator_logger']->push_prefix('exporter');      
    307          
     306        $GLOBALS['midcom_helper_replicator_logger']->push_prefix('exporter'); 
     307 
    308308        // Special case of midgard_attachment (and classes extending it) 
    309309        if (is_a($object, 'midgard_attachment')) 
     
    313313            return $this->serialize_attachment($object); 
    314314        } 
    315          
     315 
    316316        if (   version_compare(mgd_version(), '1.8.2', '>=') 
    317317            && !$skip_children) 
    318318        { 
    319             // TODO: refator to separate method(s)