Changeset 11342

Show
Ignore:
Timestamp:
07/24/07 15:40:49 (1 year ago)
Author:
w_i
Message:

Added basic profile editing support, layer,tag editing works

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/org.maemo.calendar/common.php

    r11311 r11342  
    1616    } 
    1717     
     18    function fetch_user_calendar_color($user_guid=false) 
     19    { 
     20        debug_push_class(__CLASS__, __FUNCTION__); 
     21         
     22        $logged_in = true; 
     23         
     24        $user = $_MIDCOM->auth->user->get_storage(); 
     25         
     26        if ($user_guid) 
     27        { 
     28            $logged_in = false; 
     29            $user =& new midcom_db_person($user_guid); 
     30        } 
     31         
     32        $color = $user->get_parameter('org.maemo.calendar:preferences','calendar_color'); 
     33         
     34        if (empty($color)) 
     35        { 
     36            if (   $logged_in 
     37                || (   !$logged_in 
     38                    && $_MIDCOM->auth->request_sudo()) ) 
     39            { 
     40                $user->set_parameter('org.maemo.calendar:preferences','calendar_color','FFFF99'); 
     41                $color = $user->get_parameter('org.maemo.calendar:preferences','calendar_color'); 
     42                 
     43                if (!$logged_in) 
     44                { 
     45                    $_MIDCOM->auth->drop_sudo(); 
     46                } 
     47            } 
     48            else 
     49            { 
     50                debug_add('Couldn\'t get SUDO privileges!'); 
     51            }             
     52        } 
     53         
     54        debug_print_r("User calendar color: ",$color);         
     55        debug_pop(); 
     56 
     57        return $color; 
     58    } 
     59     
     60    function update_user_calendar_color($color, $user_guid=false) 
     61    { 
     62        debug_push_class(__CLASS__, __FUNCTION__); 
     63         
     64        $logged_in = true; 
     65         
     66        $user = $_MIDCOM->auth->user->get_storage(); 
     67         
     68        if ($user_guid) 
     69        { 
     70            $logged_in = false; 
     71            $user =& new midcom_db_person($user_guid); 
     72        } 
     73 
     74        if (   $logged_in 
     75            || (   !$logged_in 
     76                && $_MIDCOM->auth->request_sudo()) ) 
     77        { 
     78            $user->set_parameter('org.maemo.calendar:preferences','calendar_color',$color); 
     79             
     80            if (!$logged_in) 
     81            { 
     82                $_MIDCOM->auth->drop_sudo(); 
     83            } 
     84        } 
     85        else 
     86        { 
     87            debug_add('Couldn\'t get SUDO privileges!'); 
     88        } 
     89 
     90        debug_pop();                 
     91        return true; 
     92    } 
     93     
     94    function save_user_tag($tag_id, $data, $user_guid=false) 
     95    { 
     96        debug_push_class(__CLASS__, __FUNCTION__); 
     97 
     98        debug_print_r('save with: ', $data); 
     99         
     100        $logged_in = true; 
     101         
     102        $user = $_MIDCOM->auth->user->get_storage(); 
     103         
     104        if ($user_guid) 
     105        { 
     106            $logged_in = false; 
     107            $user =& new midcom_db_person($user_guid); 
     108        } 
     109         
     110        if (   $logged_in 
     111            || (   !$logged_in 
     112                && $_MIDCOM->auth->request_sudo()) ) 
     113        {             
     114            $existing = $user->get_parameter('org.maemo.calendar:tag',$tag_id); 
     115         
     116            if (empty($existing)) 
     117            { 
     118                debug_add("Tag {$tag_id} doesn't exist. Create."); 
     119            } 
     120            else 
     121            {    
     122                if (   empty($tag_id) 
     123                    || empty($data['color']) 
     124                    || empty($data['name']) 
     125                    || !isset($data['ispublic']) ) 
     126                { 
     127                    debug_add("All required data wasn't available. quitting"); 
     128                    return false; 
     129                } 
     130            } 
     131             
     132            if (isset($data['color'])) 
     133            { 
     134                $user->set_parameter('org.maemo.calendar:tag',$tag_id,$data['color']);                 
     135            } 
     136            if (isset($data['name'])) 
     137            { 
     138                $user->set_parameter('org.maemo.calendar:tag_name',$tag_id,$data['name']); 
     139            } 
     140            if ($data['ispublic']) 
     141            { 
     142                $user->set_parameter('org.maemo.calendar:public_tag',$tag_id,true); 
     143            } 
     144            else 
     145            { 
     146                $user->set_parameter('org.maemo.calendar:public_tag',$tag_id); 
     147            } 
     148 
     149            if (!$logged_in) 
     150            { 
     151                $_MIDCOM->auth->drop_sudo(); 
     152            } 
     153        } 
     154        else 
     155        { 
     156            debug_add('Couldn\'t get SUDO privileges! Tags not added.'); 
     157        } 
     158              
     159        debug_pop(); 
     160        return true; 
     161    } 
     162     
    18163    function fetch_available_user_tags($user_guid=false, $only_public=false) 
    19164    { 
     
    153298        } 
    154299         
    155         $user_timezone_identifier = $user->get_parameter('org.maemo.calendar:user_timezone','identifier'); 
     300        $user_timezone_identifier = $user->get_parameter('org.maemo.calendar:preferences','timezone_identifier'); 
    156301        if (empty($user_timezone_identifier)) 
    157302        { 
     
    163308            { 
    164309                $default_timezone_name = date_default_timezone_get(); 
    165                 $user->set_parameter('org.maemo.calendar:user_timezone','identifier',$default_timezone_name); 
    166                 $user_timezone_identifier = $user->get_parameter('org.maemo.calendar:user_timezone','identifier'); 
     310                $user->set_parameter('org.maemo.calendar:preferences','timezone_identifier',$default_timezone_name); 
     311                $user_timezone_identifier = $user->get_parameter('org.maemo.calendar:preferences','timezone_identifier'); 
    167312                 
    168313                if (!$logged_in) 
  • trunk/midcom/org.maemo.calendar/config/config.inc

    r11099 r11342  
    2626 
    2727"month_column_width" => 14, 
     28 
     29 
     30'profile_schemadb' => 'file:/org/maemo/calendar/config/schemadb_default_profile.inc', 
     31'profile_schema' => 'default', 
  • trunk/midcom/org.maemo.calendar/exec/layers.php

    r11331 r11342  
    88switch ($_GET['action']) 
    99{ 
    10     case 'show_update': 
    11         handler_show_update($_GET['layer_id']); 
     10    case 'show_update_layer': 
     11        handler_show_update_layer($_GET['layer_id']); 
    1212        break; 
    13     case 'update': 
    14         handler_update(&$_POST); 
     13    case 'update_layer': 
     14        handler_update_layer($_GET['layer_id'], &$_POST); 
    1515        break; 
    1616    case 'show_update_tag': 
     
    1818        break; 
    1919    case 'update_tag': 
    20         handler_update_tag(&$_POST); 
     20        handler_update_tag($_GET['layer_id'], $_GET['tag_id'], &$_POST); 
    2121        break; 
    2222} 
    2323 
    24 function handler_update(&$data) 
     24function handler_update_layer($layer_id, &$data) 
    2525{ 
    26     echo 'updated'; 
     26    $success = false; 
     27     
     28    if (isset($data['color'])) 
     29    { 
     30        $new_color = str_replace("#", "", $data['color']); 
     31        $success = org_maemo_calendar_common::update_user_calendar_color($new_color, $layer_id);         
     32    } 
     33     
     34    if ($success) 
     35    { 
     36        echo 'updated';         
     37    } 
     38    else 
     39    { 
     40        echo 'not_updated';         
     41    } 
    2742} 
    2843 
    29 function handler_show_update($layer_id) 
     44function handler_show_update_layer($layer_id) 
    3045{ 
    3146    $html = ''; 
    3247     
     48    $form_type = 'layer'; 
     49    $form_name = "update-{$form_type}-form"; 
     50     
     51    $current_color = '#' . org_maemo_calendar_common::fetch_user_calendar_color(); 
     52     
    3353    $html .= _render_modal_win_header('Edit calendar layer'); 
    34      
    35     $html .= 'change color'; 
    36      
     54 
     55    $html .= "<form name=\"{$form_name}\" id=\"{$form_name}\">\n"; 
     56 
     57    $html .= _render_color_picker($layer_id, $form_type, $current_color); 
     58 
     59    $html .= "   <input type=\"submit\" name=\"submit\" value=\"Submit\" />"; 
     60    $html .= "   <input type=\"submit\" name=\"cancel\" value=\"Cancel\" />\n"; 
     61    $html .= "</form>\n"; 
     62   
     63    $html .= "<script>"; 
     64    $html .= "enable_layer_update_form('{$layer_id}');"; 
     65    $html .= "</script>\n"; 
     66         
    3767    $html .= _render_modal_win_footer();     
    3868     
     
    4070} 
    4171 
    42 function handler_update_tag(&$data) 
     72function handler_update_tag($layer_id, $tag_id, &$data) 
    4373{ 
    44     echo 'updated'; 
     74    $success = false; 
     75     
     76    if (! empty($data)) 
     77    { 
     78        $data['color'] = str_replace("#", "", $data['color']); 
     79        $success = org_maemo_calendar_common::save_user_tag($tag_id, $data, $layer_id);         
     80    } 
     81     
     82    if ($success) 
     83    { 
     84        echo 'updated';         
     85    } 
     86    else 
     87    { 
     88        echo 'not_updated';         
     89    } 
    4590} 
    4691 
    4792function handler_show_update_tag($layer_id, $tag_id) 
    4893{ 
     94    $users_tags = org_maemo_calendar_common::fetch_available_user_tags(); 
     95     
     96    $current_tag = array(); 
     97    foreach ($users_tags as $tag) 
     98    { 
     99        if ($tag['id'] == $tag_id) 
     100        { 
     101            $current_tag = $tag; 
     102        } 
     103    } 
     104     
    49105    $html = ''; 
     106 
     107    $form_type = 'layer_tag'; 
     108    $form_name = "update-{$form_type}-form"; 
     109    $type_id = "{$layer_id}-{$tag_id}"; 
     110     
     111    $current_color = '#' . $current_tag['color']; 
     112    $current_name = $current_tag['name']; 
     113     
     114    $public_yes_status = ''; 
     115    $public_no_status = 'checked="checked"'; 
     116    if ($current_tag['is_public']) 
     117    { 
     118        $public_yes_status = 'checked="checked"'; 
     119        $public_no_status = ''; 
     120    } 
    50121     
    51122    $html .= _render_modal_win_header('Edit tag'); 
    52123 
    53     $html .= 'change color, rename'; 
     124    $html .= "<form name=\"{$form_name}\" id=\"{$form_name}\">\n"; 
     125 
     126    $html .= _render_color_picker($type_id, $form_type, $current_color); 
     127     
     128    $html .= "   <label for=\"{$form_type}-name-{$type_id}\">Name</label>\n"; 
     129    $html .= "   <input type=\"text\" name=\"name\" id=\"{$form_type}-name-{$type_id}\" value=\"{$current_name}\" /><br />\n"; 
     130    $html .= "   <label for=\"{$form_type}-ispublic-{$type_id}\">Is public?</label>\n"; 
     131    $html .= "   <input type=\"radio\" name=\"ispublic\" value=\"1\" {$public_yes_status}/> Yes\n"; 
     132    $html .= "   <input type=\"radio\" name=\"ispublic\" value=\"0\" {$public_no_status}/> No\n"; 
     133    $html .= "   <br /><br />\n"; 
     134    $html .= "   <input type=\"submit\" name=\"submit\" value=\"Submit\" />"; 
     135    $html .= "   <input type=\"submit\" name=\"cancel\" value=\"Cancel\" />\n"; 
     136    $html .= "</form>\n"; 
     137   
     138    $html .= "<script>"; 
     139    $html .= "enable_layer_update_form('{$layer_id}','{$tag_id}');"; 
     140    $html .= "</script>\n"; 
    54141 
    55142    $html .= _render_modal_win_footer(); 
     
    62149    $html = ''; 
    63150 
    64     $html .= "<div class=\"calendar-modal-window-content\">\n"; 
     151    $html .= "\n<div class=\"calendar-modal-window-content\">\n"; 
    65152    $html .= "    <h1>{$title}</h1>\n"; 
    66153    $html .= "    <div onclick=\"close_modal_window();\">Close</div>\n"; 
     
    78165} 
    79166 
     167function _render_color_picker($type_id, $form_type, $color) 
     168{ 
     169    $html = ''; 
     170     
     171    $html .= "<div id=\"color-change-form\">"; 
     172    $html .= "   <label for=\"{$form_type}-color-{$type_id}\">Color</label><br />\n"; 
     173    $html .= "   <input type=\"text\" name=\"color\" value=\"{$color}\" id=\"{$form_type}-color-{$type_id}\" />\n"; 
     174    $html .= "   <div class=\"color-picker-toggle\" onclick=\"jQuery('#{$form_type}-color-{$type_id}-picker').toggle();\">&nbsp;</div>\n"; 
     175    $html .= "   <div id=\"{$form_type}-color-{$type_id}-picker\" class=\"color-picker\" style=\"display: none;\">&nbsp;</div>\n"; 
     176    $html .= "   <br />"; 
     177    $html .= "</div>\n";     
     178 
     179    $html .= "<script>";  
     180    $html .= "jQuery('#{$form_type}-color-{$type_id}-picker').farbtastic('#{$form_type}-color-{$type_id}');"; 
     181    $html .= "</script>\n"; 
     182     
     183    return $html; 
     184} 
     185 
    80186debug_add('---exec-midcom-org.maemo.calendar-layers END---'); 
    81187debug_pop(); 
  • trunk/midcom/org.maemo.calendar/handler/event/view.php

    r11324 r11342  
    3636     */ 
    3737    var $_controller = null; 
    38              
    39     function _prepare_request_data() 
    40     { 
    41         $this->_request_data['event'] =& $this->_event; 
    42         $this->_request_data['controller'] =& $this->_controller; 
    43     } 
    4438     
    4539    /** 
     
    4943    { 
    5044        parent::midcom_baseclasses_components_handler(); 
     45    } 
     46 
     47    function _prepare_request_data() 
     48    { 
     49        $this->_request_data['event'] =& $this->_event; 
     50        $this->_request_data['controller'] =& $this->_controller; 
    5151    } 
    5252 
     
    6969    /** 
    7070     * Loads and prepares the schema database. 
    71      * 
    72      * Special treatement is done for the name field, which is set readonly for non-creates 
    73      * if the simple_name_handling config option is set. (using an auto-generated urlname based 
    74      * on the title, if it is missing.) 
    75      * 
    76      * The operations are done on all available schemas within the DB. 
    7771     */ 
    7872    function _load_schemadb() 
     
    10094 
    10195        $this->_controller->set_storage($this->_event); 
    102         // if (! $this->_controller->initialize()) 
    103         // { 
    104         //     $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Failed to initialize a DM2 create controller."); 
    105         //     // This will exit. 
    106         // } 
    10796    } 
    10897 
  • trunk/midcom/org.maemo.calendar/handler/index.php

    r11331 r11342  
    151151        $calendar_leaf = new org_maemo_calendarpanel_calendar_leaf($this->_request_data['maemo_calender']); 
    152152        $buddylist_leaf = new org_maemo_calendarpanel_buddylist_leaf(); 
     153        $profile_leaf = new org_maemo_calendarpanel_profile_leaf(); 
    153154        $shelf_leaf = new org_maemo_calendarpanel_shelf_leaf(); 
    154155                 
    155156        $calendar_leaf->add_calendars(&$this->layer_data['calendars']); 
    156157        $buddylist_leaf->add_buddies(&$this->_all_buddies); 
     158        $profile_leaf->set_schemadb( 
     159            midcom_helper_datamanager2_schema::load_database( $this->_config->get('profile_schemadb') ), 
     160            $this->_config->get('profile_schema') 
     161        ); 
     162        $profile_leaf->set_person(&$this->current_user); 
    157163        $buddylist_leaf->add_penging_buddies(&$this->_pending_buddy_requests); 
    158164                 
    159165        $this->_request_data['panel']->add_leaf('calendar', &$calendar_leaf); 
    160166        $this->_request_data['panel']->add_leaf('buddylist', &$buddylist_leaf); 
     167        $this->_request_data['panel']->add_leaf('profile', &$profile_leaf); 
    161168        $this->_request_data['panel']->add_leaf('shelf', &$shelf_leaf); 
    162169    } 
     
    196203                'owner' => $this->current_user, 
    197204                'name' => $default_calendar_name, 
    198                 'color' => $this->user_tags[0]['color'] 
     205                'color' => org_maemo_calendar_common::fetch_user_calendar_color() 
    199206            ); 
    200207        } 
     
    211218            $public_tags = org_maemo_calendar_common::fetch_available_user_tags($person->guid, true); 
    212219 
    213             $calendar_color = $this->user_tags[0]['color'];             
    214             if (count($public_tags) > 0) 
    215             { 
    216                 $calendar_color = $public_tags[0]['color']; 
    217             } 
     220            $calendar_color = org_maemo_calendar_common::fetch_user_calendar_color($person->guid); 
    218221             
    219222            if (! isset($this->layer_data['calendars'][$calendar_id])) 
  • trunk/midcom/org.maemo.calendar/handler/profile/admin.php

    r11331 r11342  
    1515{ 
    1616    /** 
     17     * The person to register for 
     18     * 
     19     * @var array 
     20     * @access private 
     21     */ 
     22    var $_person = null; 
     23 
     24    /** 
     25     * The schema database (taken from the config) 
     26     * 
     27     * @var Array 
     28     * @access private 
     29     */ 
     30    var $_schemadb = null; 
     31     
     32    /** 
     33     * The schema (taken from the config) 
     34     * 
     35     * @var Array 
     36     * @access private 
     37     */ 
     38    var $_schema = null;     
     39 
     40    /** 
     41     * The Datamanager of the person to display. 
     42     * 
     43     * @var midcom_helper_datamanager2_datamanager 
     44     * @access private 
     45     */ 
     46    var $_controller = null; 
     47 
     48    /** 
    1749     * Simple default constructor. 
    1850     */ 
     
    2052    { 
    2153        parent::midcom_baseclasses_components_handler(); 
     54    } 
     55 
     56    function _prepare_request_data() 
     57    { 
     58        $this->_request_data['person'] =& $this->_person; 
     59        $this->_request_data['controller'] =& $this->_controller; 
     60    } 
     61     
     62    /** 
     63     * Maps the content topic from the request data to local member variables. 
     64     */ 
     65    function _on_initialize() 
     66    { 
     67    } 
     68 
     69    /** 
     70     * Loads and prepares the schema database. 
     71     */ 
     72    function _load_schemadb() 
     73    { 
     74        $this->_schemadb = midcom_helper_datamanager2_schema::load_database( $this->_config->get('profile_schemadb') ); 
     75        $this->_schema = $this->_config->get('profile_schema'); 
     76    }     
     77 
     78    /** 
     79     * Internal helper, loads the controller for the current event. Any error triggers a 500. 
     80     * 
     81     * @access private 
     82     */ 
     83    function _load_controller() 
     84    { 
     85        $this->_load_schemadb(); 
     86         
     87        $this->_controller =& midcom_helper_datamanager2_controller::create('simple'); 
     88        $this->_controller->schemadb =& $this->_schemadb; 
     89        $this->_controller->schemaname = $this->_schema; 
     90        $this->_controller->set_storage($this->_person, $this->_schema); 
     91        if (! $this->_controller->initialize()) 
     92        { 
     93            $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Failed to initialize a DM2 controller instance for person {$this->_person->id}."); 
     94            // This will exit. 
     95        } 
    2296    } 
    2397     
     
    28102            $_MIDCOM->skip_page_style = true; 
    29103        } 
     104 
     105        $this->_person = new midcom_db_person($args[0]); 
     106        if (!$this->_person) 
     107        { 
     108            return false; 
     109        } 
     110         
     111        $this->_person->require_do('midgard:update'); 
     112         
     113        $this->_load_controller(); 
     114 
     115        switch ($this->_controller->process_form()) 
     116        { 
     117            case 'save': 
     118            case 'cancel': 
     119                //$_MIDCOM->relocate("event/{$this->_event->guid}/"); 
     120                $_MIDCOM->relocate(""); 
     121                // This will exit. 
     122        } 
     123         
     124        $this->_prepare_request_data($handler_id); 
     125        $_MIDCOM->bind_view_to_object($this->_person, $this->_request_data['controller']->datamanager->schema->name);         
    30126         
    31127        return true;         
  • trunk/midcom/org.maemo.calendar/handler/profile/view.php

    r11331 r11342  
    1515{ 
    1616    /** 
     17     * The person to register for 
     18     * 
     19     * @var array 
     20     * @access private 
     21     */ 
     22    var $_person = null; 
     23 
     24    /** 
     25     * The schema database (taken from the config) 
     26     * 
     27     * @var Array 
     28     * @access private 
     29     */ 
     30    var $_schemadb = null; 
     31     
     32    /** 
     33     * The schema (taken from the config) 
     34     * 
     35     * @var Array 
     36     * @access private 
     37     */ 
     38    var $_schema = null;     
     39 
     40    /** 
     41     * The Datamanager of the person to display. 
     42     * 
     43     * @var midcom_helper_datamanager2_datamanager 
     44     * @access private 
     45     */ 
     46    var $_controller = null; 
     47 
     48    /** 
    1749     * Simple default constructor. 
    1850     */ 
     
    2254    } 
    2355     
     56    function _prepare_request_data() 
     57    { 
     58        $this->_request_data['person'] =& $this->_person; 
     59        $this->_request_data['controller'] =& $this->_controller; 
     60    } 
     61 
     62    /** 
     63     * Loads and prepares the schema database. 
     64     */ 
     65    function _load_schemadb() 
     66    { 
     67        $this->_schemadb = midcom_helper_datamanager2_schema::load_database( $this->_config->get('profile_schemadb') ); 
     68        $this->_schema = $this->_config->get('profile_schema'); 
     69    } 
     70 
     71    /** 
     72     * Internal helper 
     73     * 
     74     * @access private 
     75     */ 
     76    function _load_controller() 
     77    { 
     78        $this->_load_schemadb(); 
     79 
     80        $this->_controller =& new midcom_helper_datamanager2_datamanager($this->_schemadb); 
     81 
     82        if (   ! $this->_controller 
     83            || ! $this->_controller->set_schema($this->_schema) ) 
     84        { 
     85            $_MIDCOM->generate_error(MIDCOM_ERRCRIT, 'Failed to create a DM2 instance.'); 
     86            // This will exit. 
     87        } 
     88 
     89        $this->_controller->set_storage($this->_person); 
     90    } 
     91 
    2492    function _handler_view($handler_id, $args, &$data) 
    2593    { 
     94        debug_push_class(__CLASS__, __FUNCTION__); 
     95         
    2696        if ($handler_id == 'ajax-profile-view') 
    2797        { 
     
    2999        } 
    30100         
     101        $this->_person = new midcom_db_person($args[0]); 
     102        if (!$this->_person) 
     103        { 
     104            return false; 
     105        } 
     106 
     107        $this->_load_controller(); 
     108         
     109        $this->_prepare_request_data(); 
     110         
     111        debug_pop(); 
    31112        return true; 
    32113    } 
  • trunk/midcom/org.maemo.calendar/static/js/calendar.js

    r11331 r11342  
    626626    console.log('edit_calendar_layer_properties layer_id: '+layer_id); 
    627627 
    628     var url = 'midcom-exec-org.maemo.calendar/layers.php?action=show_update&layer_id='+layer_id; 
     628    var url = 'midcom-exec-org.maemo.calendar/layers.php?action=show_update_layer&layer_id='+layer_id; 
    629629    load_modal_window(url); 
    630630} 
     
    635635    var url = 'midcom-exec-org.maemo.calendar/layers.php?action=show_update_tag&layer_id='+layer_id+'&tag_id='+tag_id; 
    636636    load_modal_window(url); 
     637} 
     638 
     639function enable_layer_update_form(layer_id, tag_id) 
     640{ 
     641    console.log('enable_color_change_form layer_id: '+layer_id+' tag_id: '+tag_id); 
     642     
     643    var type = 'layer'; 
     644    var url = 'midcom-exec-org.maemo.calendar/layers.php?action=update_layer&layer_id='+layer_id; 
     645    if (tag_id != undefined) 
     646    { 
     647        type = 'layer_tag'; 
     648        url = 'midcom-exec-org.maemo.calendar/layers.php?action=update_tag&layer_id='+layer_id+'&tag_id='+tag_id; 
     649    } 
     650         
     651    jQuery.ajaxSetup({global: false}); 
     652    var options = {  
     653        beforeSubmit:  show_processing, 
     654        success:       processing_successfull, 
     655        url:       APPLICATION_PREFIX + url, 
     656        type:      'post', 
     657        //dataType:  'json', 
     658        timeout:   12000 
     659    };  
     660     
     661    var form_id = '#update-' + type + '-form';     
     662    jQuery(form_id).ajaxForm(options); 
     663} 
     664 
     665function show_processing(formData, jqForm, options) 
     666{ 
     667    console.log('show_processing'); 
     668} 
     669function processing_successfull(responseText, statusText) 
     670{ 
     671    console.log('processing_successfull'); 
     672    close_modal_window(); 
     673     
     674    if (responseText == 'updated') 
     675    { 
     676        window.location.reload(true); 
     677    } 
    637678} 
    638679 
  • trunk/midcom/org.maemo.calendar/static/styles/elements.css

    r11327 r11342  
    320320 
    321321/* Buddylist search end */ 
     322 
     323.color-picker-toggle 
     324{ 
     325    width: 16px; 
     326    height: 16px; 
     327    background: url(../images/icons/color-picker.png) top left no-repeat; 
     328} 
     329.color-picker 
     330{ 
     331    position: absolute; 
     332    top: 0px; 
     333    right: 0px; 
     334    margin-right: 30px; 
     335} 
  • trunk/midcom/org.maemo.calendar/style/profile-edit-ajax.php

    r11331 r11342  
    66    <div onclick="close_modal_window();">Close</div> 
    77     
    8     Personal details, tags 
     8    <?php  
     9    $data['controller']->display_form();  
     10    ?> 
    911     
    1012</div> 
  • trunk/midcom/org.maemo.calendar/style/profile-view-ajax.php

    r11331 r11342  
    66    <div onclick="close_modal_window();">Close</div> 
    77         
    8     Personal details, tags 
     8    <?php  
     9    $data['controller']->display_view(); 
     10    ?>     
    911     
    1012</div> 
  • trunk/midcom/org.maemo.calendar/viewer.php

    r11331 r11342  
    180180            ) 
    181181        ); 
     182        $_MIDCOM->add_link_head 
     183        ( 
     184            array 
     185            ( 
     186                'rel' => 'stylesheet', 
     187                'type' => 'text/css', 
     188                'href' => MIDCOM_STATIC_URL."/org.maemo.calendar/styles/farbtastic.css", 
     189            ) 
     190        );         
    182191        // $_MIDCOM->add_link_head 
    183192        // ( 
     
    229238        $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/jQuery/jquery.flydom-3.0.6.js'); 
    230239        $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/jQuery/jquery.form-1.0.1.js'); 
    231                  
     240        $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/org.maemo.calendar/js/jquery.farbtastic.js'); 
     241                         
    232242        //$_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/org.openpsa.helpers/ajaxutils.js', false); 
    233243        //$_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/org.openpsa.relatedto/related_to.js', false);