]> git.mxchange.org Git - friendica.git/commitdiff
enable ajax calendar with $a->config['experimentals']['new_calendar']=1
authorFabio Comuni <fabrix.xm@gmail.com>
Wed, 15 Feb 2012 11:47:50 +0000 (12:47 +0100)
committerFabio Comuni <fabrix.xm@gmail.com>
Wed, 15 Feb 2012 11:47:50 +0000 (12:47 +0100)
mod/events.php
mod/settings.php
view/events-js.tpl [new file with mode: 0644]
view/events.tpl

index e10f508dd6a9e5efcfa9bcbdc983d52f35d8a388..0906d16c2ee21687c32bc5d3e7553df82c0ba9d2 100755 (executable)
@@ -284,7 +284,11 @@ function events_content(&$a) {
                if (x($_GET,'id')){
                        $tpl =  get_markup_template("event.tpl");
                } else {
-                       $tpl = get_markup_template("events.tpl");
+                       if (get_config('experimentals','new_calendar')==1){
+                               $tpl = get_markup_template("events-js.tpl");
+                       } else {
+                               $tpl = get_markup_template("events.tpl");
+                       }
                }
                $o = replace_macros($tpl, array(
                        '$baseurl'      => $a->get_baseurl(),
index b4cd2e608a92f749a105a374e0b61f15406f8fe5..57a4e6db03e9967028e37f1cc541b2406c78fcac 100755 (executable)
@@ -734,8 +734,11 @@ function settings_content(&$a) {
        if($files) {
                foreach($files as $file) {
                        $f = basename($file);
-                       $theme_name = ((file_exists($file . '/experimental')) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
-                       $themes[$f]=$theme_name;
+                       $is_experimental = file_exists($file . '/experimental');
+                       if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){ 
+                               $theme_name = (($is_experimental) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
+                               $themes[$f]=$theme_name;
+                       }
                }
        }
        $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
diff --git a/view/events-js.tpl b/view/events-js.tpl
new file mode 100644 (file)
index 0000000..b0e182c
--- /dev/null
@@ -0,0 +1,6 @@
+$tabs
+<h2>$title</h2>
+
+<div id="new-event-link"><a href="$new_event.0" >$new_event.1</a></div>
+
+<div id="events-calendar"></div>
index b0e182c56dcf26c5fc27c9dc859765b6b8d97102..5a9787de36632520b6696e9d839247d363028911 100644 (file)
@@ -3,4 +3,22 @@ $tabs
 
 <div id="new-event-link"><a href="$new_event.0" >$new_event.1</a></div>
 
-<div id="events-calendar"></div>
+<div id="event-calendar-wrapper">
+       <a href="$previus.0" class="prevcal $previus.2"><div id="event-calendar-prev" class="icon s22 prev" title="$previus.1"></div></a>
+       $calendar
+       <a href="$next.0" class="nextcal $next.2"><div id="event-calendar-prev" class="icon s22 next" title="$next.1"></div></a>
+</div>
+<div class="event-calendar-end"></div>
+
+
+{{ for $events as $event }}
+       <div class="event">
+       {{ if $event.is_first }}<hr /><a name="link-$event.j" ><div class="event-list-date">$event.d</div></a>{{ endif }}
+       {{ if $event.item.author-name }}<a href="$event.item.author-link" ><img src="$event.item.author-avatar" height="32" width="32" />$event.item.author-name</a>{{ endif }}
+       $event.html
+       {{ if $event.item.plink }}<a href="$event.plink.0" title="$event.plink.1" target="external-link" class="plink-event-link icon s22 remote-link"></a>{{ endif }}
+       {{ if $event.edit }}<a href="$event.edit.0" title="$event.edit.1" class="edit-event-link icon s22 pencil"></a>{{ endif }}
+       </div>
+       <div class="clear"></div>
+
+{{ endfor }}