diff --git a/ajax/post-config.php b/ajax/post-config.php index 3db381c..105c98a 100644 --- a/ajax/post-config.php +++ b/ajax/post-config.php @@ -1,12 +1,15 @@ item; @@ -17,6 +20,9 @@ $config_xml[3]->visibility = $search; $config_xml[4]->visibility = $links; $config_xml[5]->visibility = $blogs; $config_xml[6]->visibility = $todo; +$config_xml[7]->visibility = $clockAdvanced; +$config_xml[8]->visibility = $rssblogs; +$config_xml[9]->visibility = $news; $xmla->asXML('../db/config.xml'); echo "1"; diff --git a/class/Links.php b/class/Links.php index c6c54f3..97a68f5 100644 --- a/class/Links.php +++ b/class/Links.php @@ -24,6 +24,8 @@ class links { echo '
'; } + }else{ + echo 'Can\'t find '.self::LINKS_FILE; } echo ''; } diff --git a/class/News.php b/class/News.php new file mode 100644 index 0000000..5d24fa3 --- /dev/null +++ b/class/News.php @@ -0,0 +1,60 @@ +setParams($params); + echo ' +
+ '; + } + + private function setParams($params){ + $this->params = $params; + } + + public static function start($params){ + $news = new news($params); + } + + public function setVisibility($visibility){ + // Saving the position and z-index of the note: + $xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE); + + $path = $xmla->xpath("//item[@id='news']"); + $path[0]->visibility = $visibility; + + $xmla->asXML('../'.AccueilModules::CONFIG_FILE); + + echo "ok"; + } + + public static function updateConfig($updated){ + foreach ($updated as $what=>$withWhat){ + if(in_array($what, self::$paramsList)){ + call_user_func(array(get_class(), "set".ucfirst($what)), $withWhat); + } + } + } +} \ No newline at end of file diff --git a/js/getUncompletedTasks.php b/js/getUncompletedTasks.php index b46ced1..511f32b 100644 --- a/js/getUncompletedTasks.php +++ b/js/getUncompletedTasks.php @@ -52,5 +52,5 @@ $(document).ready(function(){ $('#todo').resizable(); $('#todo').draggable(); document.getElementsByTagName('head')[0].appendChild(script); $('#'+arrayId[1]).remove(); }); - /* A helper function for converting a set of elements to draggables: */ make_draggable($('#todo')); var zIndex = 0; function make_draggable(elements) { /* Elements is a jquery object: */ elements.draggable({ snap:true, containment:'parent', start:function(e,ui){ ui.helper.css('z-index',++zIndex); }, stop:function(e,ui){ /* Sending the z-index and positon of the note to update_position.php via AJAX GET: */ $.get('ajax/update_position_config.php',{ x : ui.position.left, y : ui.position.top, id : ui.helper.attr('id') }); } }); } + /* A helper function for converting a set of elements to draggables: */ make_draggable($('#todo')); }); \ No newline at end of file diff --git a/js/jquery.blogs.js b/js/jquery.blogs.js index 6423cbd..01cd285 100644 --- a/js/jquery.blogs.js +++ b/js/jquery.blogs.js @@ -1,27 +1,7 @@ $(document).ready(function(){ -var zIndex = 0; $('#menu-bar').prepend($('#blog-links-manager')); -function make_draggable(elements) -{ - /* Elements is a jquery object: */ - elements.draggable({ - snap:true, - containment:'parent', - start:function(e,ui){ ui.helper.css('z-index',++zIndex); }, - stop:function(e,ui){ - - /* Sending the z-index and positon of the note to update_position.php via AJAX GET: */ - $.get('ajax/update_position_config.php',{ - x : ui.position.left, - y : ui.position.top, - id : ui.helper.attr('id') - }); - } - }); -} - //affichage des blogs $("#blogs").html(" Loading Blogs..."); var tmp; diff --git a/js/jquery.jclock.js b/js/jquery.jclock.js index d0465e2..aa9aa47 100644 --- a/js/jquery.jclock.js +++ b/js/jquery.jclock.js @@ -216,23 +216,4 @@ $(document).ready(function(){ /* A helper function for converting a set of elements to draggables: */ make_draggable($('.jclock')); -var zIndex = 0; - -function make_draggable(elements) -{ - /* Elements is a jquery object: */ - elements.draggable({ - snap:true, - containment:'parent', - start:function(e,ui){ ui.helper.css('z-index',++zIndex); }, - stop:function(e,ui){ - - /* Sending the z-index and positon of the note to update_position.php via AJAX GET: */ - $.get('update_position_config.php',{ - x : ui.position.left, - y : ui.position.top, - id : ui.helper.attr('id') - }); - } - });} }); diff --git a/js/jquery.weather.js b/js/jquery.weather.js index 6a9d6bf..ce57fd1 100644 --- a/js/jquery.weather.js +++ b/js/jquery.weather.js @@ -26,24 +26,5 @@ $(document).ready(function(){ /* A helper function for converting a set of elements to draggables: */ make_draggable($('#weather')); -var zIndex = 0; -function make_draggable(elements) -{ - /* Elements is a jquery object: */ - elements.draggable({ - snap:true, - containment:'parent', - start:function(e,ui){ ui.helper.css('z-index',++zIndex); }, - stop:function(e,ui){ - - /* Sending the z-index and positon of the note to update_position.php via AJAX GET: */ - $.get('ajax/update.php',{ - x : ui.position.left, - y : ui.position.top, - id : ui.helper.attr('id') - }); - } - }); -} }); diff --git a/js/main.js b/js/main.js index 1cd5a33..577727c 100644 --- a/js/main.js +++ b/js/main.js @@ -35,6 +35,27 @@ { window.open("calculator.html", "Calc", "menubar=0,resizable=0,width=320,height=360") } + + var zIndex = 0; + +function make_draggable(elements) +{ + /* Elements is a jquery object: */ + elements.draggable({ + snap:true, + containment:'parent', + start:function(e,ui){ ui.helper.css('z-index',++zIndex); }, + stop:function(e,ui){ + + /* Sending the z-index and positon of the note to update_position.php via AJAX GET: */ + $.get('ajax/update.php',{ + x : ui.position.left, + y : ui.position.top, + id : ui.helper.attr('id') + }); + } + }); +} $(document).ready(function(){ $('body').prepend(''); $('#menu-bar').prepend($('#config-menu')); @@ -57,26 +78,5 @@ $(document).ready(function(){ 'hideOnContentClick': false, 'padding' : 15 }); - /*$('#config-submit').live('click',function(e){ - $(this).replaceWith(''); - var data3 = { - 'clock' : $('input[type=radio][name=clock_group]:checked').attr('value'), - 'weather' : $('input[type=radio][name=weather_group]:checked').attr('value'), - 'notes' : $('input[type=radio][name=notes_group]:checked').attr('value'), - 'search' : $('input[type=radio][name=search_group]:checked').attr('value'), - 'links' : $('input[type=radio][name=links_group]:checked').attr('value'), - 'blogs' : $('input[type=radio][name=blogs_group]:checked').attr('value'), - 'todo' : $('input[type=radio][name=todo_group]:checked').attr('value') - }; - - $.post('ajax/post-config.php',data3,function(msg3){ - if(msg3=="1"){ - location.reload(); - } - }); - e.preventDefault(); - });*/ - - });