Changeset 45


Ignore:
Timestamp:
02/10/2010 02:46:19 AM (3 years ago)
Author:
someotherguy
Message:

Adding Swift Mailer.

Location:
trunk/Upload
Files:
167 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Upload/admin.php

    r37 r45  
    111111$folder = $trellis->input['section']; 
    112112 
    113 if ( in_array( $trellis->input['page'], $choice[ $trellis->input['section'] ] ) ) $required = $trellis->input['page']; 
     113if ( $folder && in_array( $trellis->input['page'], $choice[ $folder ] ) ) $required = $trellis->input['page']; 
    114114 
    115115if ( ! isset( $required ) ) 
  • trunk/Upload/admin/tools/ad_settings.php

    r37 r45  
    130130                if ( ! $cg = $this->trellis->settings->get_single_group( array( 'cg_key', 'cg_name' ), array( 'cg_key', '=', $this->trellis->input['group'] ) ) ) $this->trellis->skin->error('no_settings'); 
    131131 
    132                 if ( ! $settings = $this->trellis->settings->get_settings( array( 'select' => array( 'cf_id', 'cf_name', 'cf_description', 'cf_type', 'cf_default', 'cf_extra', 'cf_value', 'cf_value_old' ), 'where' => array( 'cf_group', '=', $cg['cg_key'] ), 'order' => array( 'cf_position' => 'asc' ) ) ) ) $this->trellis->skin->error('no_settings'); 
     132                if ( ! $settings = $this->trellis->settings->get_settings( array( 'select' => array( 'cf_id', 'cf_key', 'cf_name', 'cf_description', 'cf_type', 'cf_default', 'cf_extra', 'cf_value', 'cf_value_old', 'cf_callback' ), 'where' => array( 'cf_group', '=', $cg['cg_key'] ), 'order' => array( 'cf_position' => 'asc' ) ) ) ) $this->trellis->skin->error('no_settings'); 
    133133 
    134134                #============================= 
     
    147147                foreach( $settings as $cf ) 
    148148                { 
    149                         if ( $cf['cf_type'] == 'textfield' ) 
    150                         { 
    151                                 $cf_html = $this->trellis->skin->textfield( array( 'name' => 'cf_'. $cf['cf_id'], 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
     149                        if ( $cf['cf_callback'] ) 
     150                        { 
     151                #* Use this for plugin system later 
     152 
     153                            $function = $cg['cg_key'] .'_'. $cf['cf_key']; 
     154 
     155                           $cf = $this->$function( $cf ); 
     156                        } 
     157                    elseif ( $cf['cf_type'] == 'textfield' ) 
     158                        { 
     159                                $cf['cf_html'] = $this->trellis->skin->textfield( array( 'name' => 'cf_'. $cf['cf_id'], 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
    152160                        } 
    153161                        elseif ( $cf['cf_type'] == 'textarea' ) 
    154162                        { 
    155                                 $cf_html = $this->trellis->skin->textarea( array( 'name' => 'cf_'. $cf['cf_id'], 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
     163                                $cf['cf_html'] = $this->trellis->skin->textarea( array( 'name' => 'cf_'. $cf['cf_id'], 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
    156164                        } 
    157165                        elseif ( $cf['cf_type'] == 'yes_no' ) 
    158166                        { 
    159                                 $cf_html = $this->trellis->skin->yes_no_radio( array( 'name' => 'cf_'. $cf['cf_id'], 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
     167                                $cf['cf_html'] = $this->trellis->skin->yes_no_radio( array( 'name' => 'cf_'. $cf['cf_id'], 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
    160168                        } 
    161169                        elseif ( $cf['cf_type'] == 'enabled_disabled' ) 
    162170                        { 
    163                                 $cf_html = $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'cf_'. $cf['cf_id'], 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
     171                                $cf['cf_html'] = $this->trellis->skin->enabled_disabled_radio( array( 'name' => 'cf_'. $cf['cf_id'], 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
    164172                        } 
    165173                        elseif ( $cf['cf_type'] == 'dropdown' ) 
    166174                        { 
    167                                 $cf_html = $this->trellis->skin->textarea( array( 'name' => 'cf_'. $cf['cf_id'], 'options' => unserialize( $cf['cf_extra'] ), 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
     175                                $cf['cf_html'] = $this->trellis->skin->drop_down( array( 'name' => 'cf_'. $cf['cf_id'], 'options' => unserialize( $cf['cf_extra'] ), 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
    168176                        } 
    169177                        elseif ( $cf['cf_type'] == 'radio' ) 
    170178                        { 
    171                                 $cf_html = $this->trellis->skin->custom_radio( array( 'name' => 'cf_'. $cf['cf_id'], 'options' => unserialize( $cf['cf_extra'] ), 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
     179                                $cf['cf_html'] = $this->trellis->skin->custom_radio( array( 'name' => 'cf_'. $cf['cf_id'], 'options' => unserialize( $cf['cf_extra'] ), 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
    172180                        } 
    173181 
    174182                        if ( $cf['cf_description'] ) 
    175183                        { 
    176                                 $this->output .= $this->trellis->skin->group_table_row( $cf['cf_name'] .' '. $this->trellis->skin->help_tip( $cf['cf_description'] ), $cf_html, 'a', '35%', '65%' ); 
     184                                $this->output .= $this->trellis->skin->group_table_row( $cf['cf_name'] .' '. $this->trellis->skin->help_tip( $cf['cf_description'] ), $cf['cf_html'], 'a', '35%', '65%', $cf['cf_hide'], 'cfr_'. $cf['cf_id'] ); 
    177185                        } 
    178186                        else 
    179187                        { 
    180                                 $this->output .= $this->trellis->skin->group_table_row( $cf['cf_name'], $cf_html, 'a', '35%', '65%' ); 
     188                                $this->output .= $this->trellis->skin->group_table_row( $cf['cf_name'], $cf['cf_html'], 'a', '35%', '65%', $cf['cf_hide'], 'cfr_'. $cf['cf_id'] ); 
    181189                        } 
    182190                } 
     
    185193                                                ". $this->trellis->skin->end_form( $this->trellis->skin->submit_button( 'edit', '{lang.button_edit_settings}' ) ) ." 
    186194                                                </div>"; 
     195 
     196                if ( ! empty( $this->javascript ) ) 
     197                { 
     198                    $this->output .= "<script language='javascript' type='text/javascript'>\n"; 
     199 
     200                    foreach ( $this->javascript as $javascript ) 
     201                    { 
     202                        $this->output .= $javascript ."\n"; 
     203                    } 
     204 
     205                    $this->output .= "</script>"; 
     206                } 
    187207 
    188208                $menu_items = array( 
     
    215235                foreach( $settings as $cf ) 
    216236                { 
    217                         if ( $cf['cf_value'] != $this->trellis->input[ 'cf_'. $cf['cf_id'] ] ) 
     237                        if ( isset( $this->trellis->input[ 'cf_'. $cf['cf_id'] ] ) && $cf['cf_value'] != $this->trellis->input[ 'cf_'. $cf['cf_id'] ] ) 
    218238                        { 
    219239                                $this->trellis->settings->edit( array( 'cf_value' => $this->trellis->input[ 'cf_'. $cf['cf_id'] ], 'cf_value_old' => $cf['cf_value'] ), $cf['cf_id'] ); 
     
    343363        } 
    344364 
     365        #======================================= 
     366        # @ Email Transport Check 
     367        #======================================= 
     368 
     369        private function email_transport($cf) 
     370        { 
     371            $cf['cf_html'] = $this->trellis->skin->drop_down( array( 'name' => 'cf_'. $cf['cf_id'], 'options' => unserialize( $cf['cf_extra'] ), 'value' => $cf['cf_value'], 'revert' => $cf['cf_value_old'], 'default' => $cf['cf_default'], 'id' => $cf['cf_id'] ) ); 
     372 
     373            $cf['cf_html'] .= $this->trellis->skin->setting_alert( array( 'check' => 0, 'for' => 1, 'msg' => '{lang.warn_comments_global}' ) ); 
     374 
     375            return $cf; 
     376        } 
     377 
    345378} 
    346379 
  • trunk/Upload/includes/classes/class_askin.php

    r44 r45  
    590590                        if ( $default ) $html .= $this->default_html( $params['id'] ); 
    591591 
    592                         $html .= "</div><div align='left'>"; 
     592                        $html .= "</div>"; 
    593593                } 
    594594 
     
    606606 
    607607                if ( $params['alert'] ) $html .= $this->setting_alert( $params['alert'] ); 
    608  
    609                 if ( $revert || $default ) $html .= "</div>"; 
    610608 
    611609                return $html; 
     
    642640                        if ( $default ) $html .= $this->default_html( $params['id'] ); 
    643641 
    644                         $html .= "</div><div align='left'>"; 
     642                        $html .= "</div>"; 
    645643                } 
    646644 
     
    658656 
    659657                if ( $params['alert'] ) $html .= $this->setting_alert( $params['alert'] ); 
    660  
    661                 if ( $revert || $default ) $html .= "</div>"; 
    662658 
    663659                return $html; 
     
    693689                        if ( $default ) $html .= $this->default_html( $params['id'] ); 
    694690 
    695                         $html .= "</div><div align='left'>"; 
     691                        $html .= "</div>"; 
    696692                } 
    697693 
     
    707703 
    708704                if ( $params['alert'] ) $html .= $this->setting_alert( $params['alert'] ); 
    709  
    710                 if ( $revert || $default ) $html .= "</div>"; 
    711705 
    712706                return $html; 
     
    745739                        if ( $default ) $html .= $this->default_html( $params['id'] ); 
    746740 
    747                         $html .= "</div><div align='left'>"; 
     741                        $html .= "</div>"; 
    748742                } 
    749743 
     
    756750 
    757751                if ( $params['alert'] ) $html .= $this->setting_alert( $params['alert'] ); 
    758  
    759                 if ( $revert || $default ) $html .= "</div>"; 
    760752 
    761753                return $html; 
     
    793785                        if ( $default ) $html .= $this->default_html( $params['id'] ); 
    794786 
    795                         $html .= "</div><div align='left'>"; 
     787                        $html .= "</div>"; 
    796788                } 
    797789 
     
    803795 
    804796                $html .= " />"; 
    805  
    806                 if ( $revert || $default ) $html .= "</div>"; 
    807797 
    808798                return $html; 
     
    883873                        if ( $default ) $html .= $this->default_html( $params['id'] ); 
    884874 
    885                         $html .= "</div><div align='left'>"; 
     875                        $html .= "</div>"; 
    886876                } 
    887877 
     
    907897                $html .= "</select>"; 
    908898 
    909                 if ( $revert || $default ) $html .= "</div>"; 
    910  
    911899                return $html; 
    912900        } 
     
    10181006        #======================================= 
    10191007 
    1020         public function group_table_row($left, $right, $group='', $left_width=0, $right_width=0) 
     1008        public function group_table_row($left, $right, $group='', $left_width=0, $right_width=0, $hide=0, $id='') 
    10211009        { 
    10221010                if ( $group && isset( $this->groups[ $group ] ) ) 
     
    10341022                if ( $right_width ) $rwidth = " width='{$right_width}'"; 
    10351023 
    1036                 return "<tr> 
     1024                if ( $hide ) $hide = " style='display:none'"; 
     1025 
     1026                if ( $id ) $id = " id='{$id}'"; 
     1027 
     1028                return "<tr{$hide}{$id}> 
    10371029                                        <td class='{$class}'{$lwidth} valign='top'>{$left}</td> 
    10381030                                        <td class='{$class}'{$rwidth} valign='top' style='font-weight: normal'>{$right}</td> 
  • trunk/Upload/language/en/ad_lang_settings.php

    r2 r45  
    6363'auto' => 'Auto', 
    6464 
     65'email_transport_smtp' => 'SMTP', 
     66'email_transport_sendmail' => 'Sendmail', 
     67'email_transport_mail' => 'Mail', 
     68'email_smtp_encryption_none' => 'None', 
     69'email_smtp_encryption_ssl' => 'SSL', 
     70'email_smtp_encryption_tls' => 'TLS', 
     71 
    6572); 
    6673 
Note: See TracChangeset for help on using the changeset viewer.