fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [14534] temporary quick template selector


From: Sigurd Nes
Subject: [Fmsystem-commits] [14534] temporary quick template selector
Date: Mon, 07 Dec 2015 15:38:23 +0000

Revision: 14534
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14534
Author:   sigurdne
Date:     2015-12-07 15:38:23 +0000 (Mon, 07 Dec 2015)
Log Message:
-----------
temporary quick template selector

Modified Paths:
--------------
    branches/dev-syncromind/phpgwapi/templates/portico/head.inc.php
    branches/dev-syncromind/phpgwapi/templates/portico/js/base.js
    branches/dev-syncromind/phpgwapi/templates/portico/navbar.tpl
    branches/dev-syncromind/phpgwapi/templates/pure/head.inc.php
    branches/dev-syncromind/phpgwapi/templates/pure/js/mmenu.js
    branches/dev-syncromind/phpgwapi/templates/pure/navbar.tpl
    branches/dev-syncromind/preferences/preferences.php

Modified: branches/dev-syncromind/phpgwapi/templates/portico/head.inc.php
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/portico/head.inc.php     
2015-12-06 12:45:08 UTC (rev 14533)
+++ branches/dev-syncromind/phpgwapi/templates/portico/head.inc.php     
2015-12-07 15:38:23 UTC (rev 14534)
@@ -90,6 +90,26 @@
                }
        }
 
+
+       
switch($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
+       {
+               case 'portico':
+                       $selecte_portico = ' selected = "selected"';
+                       $selecte_pure = '';
+                       break;
+               case 'pure':
+                       $selecte_portico = '';
+                       $selecte_pure = ' selected = "selected"';
+                       break;
+       }
+
+       $template_selector = <<<HTML
+
+   <select id = "template_selector">
+       <option value="pure"{$selecte_pure}>Template 1</option>
+       <option value="portico"{$selecte_portico}>Template 2</option>
+   </select>
+HTML;
        // Construct navbar_config by taking into account the current selected 
menu
        // The only problem with this loop is that leafnodes will be included
        $navbar_config = execMethod('phpgwapi.template_portico.retrieve_local', 
'navbar_config');
@@ -139,7 +159,8 @@
                'border_layout_config' => $_border_layout_config,
                'navbar_config' => $_navbar_config,
                'lang_collapse_all'     => lang('collapse all'),
-               'lang_expand_all'       => lang('expand all')
+               'lang_expand_all'       => lang('expand all'),
+               'template_selector'     => $template_selector
        );
 
        $GLOBALS['phpgw']->template->set_var($tpl_vars);

Modified: branches/dev-syncromind/phpgwapi/templates/portico/js/base.js
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/portico/js/base.js       
2015-12-06 12:45:08 UTC (rev 14533)
+++ branches/dev-syncromind/phpgwapi/templates/portico/js/base.js       
2015-12-07 15:38:23 UTC (rev 14534)
@@ -1,49 +1,49 @@
-       var pageLayout;
+var pageLayout;
 
-       $(document).ready(function(){
-               // create page layout
-               pageLayout = $('body').layout({
-                       stateManagement__enabled:       true
-               ,       defaults: {
-                       }
-               ,       north: {
-                               size:                                   "auto"
-                       ,       spacing_open:                   0
-                       ,       closable:                               false
-                       ,       resizable:                              false
-                       }
-               ,       west: {
-                               size:                                   250
-                       ,       spacing_closed:                 22
-                       ,       togglerLength_closed:   140
-                       ,       togglerAlign_closed:    "top"
-                       ,       togglerContent_closed:  
"C<BR>o<BR>n<BR>t<BR>e<BR>n<BR>t<BR>s"
-                       ,       togglerTip_closed:              "Open & Pin 
Contents"
-                       ,       sliderTip:                              "Slide 
Open Contents"
-                       ,       slideTrigger_open:              "mouseover"
-                       ,       initClosed:                             true
-                       }
-               ,       east: {
-                               initClosed:                             true
-                       ,       initHidden:                             true
-                       ,       spacing_closed:                 0
-               //      ,   closable:                           false
-                       ,       resizable:                              true
-                       ,   slidable:                           true
+$(document).ready(function () {
+       // create page layout
+       pageLayout = $('body').layout({
+               stateManagement__enabled: true
+               , defaults: {
+               }
+               , north: {
+                       size: "auto"
+                       , spacing_open: 0
+                       , closable: false
+                       , resizable: false
+               }
+               , west: {
+                       size: 250
+                       , spacing_closed: 22
+                       , togglerLength_closed: 140
+                       , togglerAlign_closed: "top"
+                       , togglerContent_closed: 
"C<BR>o<BR>n<BR>t<BR>e<BR>n<BR>t<BR>s"
+                       , togglerTip_closed: "Open & Pin Contents"
+                       , sliderTip: "Slide Open Contents"
+                       , slideTrigger_open: "mouseover"
+                       , initClosed: true
+               }
+               , east: {
+                       initClosed: true
+                       , initHidden: true
+                       , spacing_closed: 0
+                                       //      ,   closable:                   
        false
+                       , resizable: true
+                       , slidable: true
 
-                       }
-               ,       south: {
-                       maxSize:                                200
-               ,       spacing_closed:                 0                       
// HIDE resizer & toggler when 'closed'
-               ,       spacing_open:                   0
-               ,       slidable:                               false           
// REFERENCE - cannot slide if spacing_closed = 0
-               ,       initClosed:                             false
-               ,       resizable:                              false
-                       }
+               }
+               , south: {
+                       maxSize: 200
+                       , spacing_closed: 0                     // HIDE resizer 
& toggler when 'closed'
+                       , spacing_open: 0
+                       , slidable: false               // REFERENCE - cannot 
slide if spacing_closed = 0
+                       , initClosed: false
+                       , resizable: false
+               }
 
-               });
+       });
 
-               pageLayout.hide("east");
+       pageLayout.hide("east");
 //
 //             console.log(localStorage);
 //             if (typeof(localStorage['pageLayout_west_closed']) != 
'undefined' && localStorage['pageLayout_west_closed'] == 1)
@@ -51,28 +51,46 @@
 //                     pageLayout.show("west");
 //             }
 
-               /**
-                * Experimental : requires live update of js and css
-                * @param {type} requestUrl
-                */
-               update_content = function(requestUrl)
-               {
+       /**
+        * Experimental : requires live update of js and css
+        * @param {type} requestUrl
+        */
+       update_content = function (requestUrl)
+       {
 
-                       window.location.href = requestUrl;
-                       return false;
-                       requestUrl += '&phpgw_return_as=stripped_html';
-                       $.ajax({
-                               type: 'GET',
-                               url: requestUrl,
-                               success: function (data) {
-                                       if (data != null)
-                                       {
-                                               $("#center_content").html(data);
-                                       }
+               window.location.href = requestUrl;
+               return false;
+               requestUrl += '&phpgw_return_as=stripped_html';
+               $.ajax({
+                       type: 'GET',
+                       url: requestUrl,
+                       success: function (data) {
+                               if (data != null)
+                               {
+                                       $("#center_content").html(data);
                                }
-                       });
+                       }
+               });
 
-               }
+       }
 
+       $("#template_selector").change(function () {
 
-       });
\ No newline at end of file
+               var template = $(this).val();
+               //user[template_set] = template;
+               var oArgs = {appname: 'preferences', type: 'user'};
+               var requestUrl = phpGWLink('preferences/preferences.php', 
oArgs, true);
+
+               $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       data: {user: {template_set: template}, submit: true},
+                       url: requestUrl,
+                       success: function (data) {
+                               console.log(data);
+                               location.reload(true);
+                       }
+               });
+       });
+
+});
\ No newline at end of file

Modified: branches/dev-syncromind/phpgwapi/templates/portico/navbar.tpl
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/portico/navbar.tpl       
2015-12-06 12:45:08 UTC (rev 14533)
+++ branches/dev-syncromind/phpgwapi/templates/portico/navbar.tpl       
2015-12-07 15:38:23 UTC (rev 14534)
@@ -17,7 +17,8 @@
                        <div class="ui-layout-north">
                                <div id="logo">{site_title}</div>
                                        <div id="navigation">
-                                               <a href="{print_url}" 
class="icon icon-print" target="_blank">
+                                       {template_selector}
+                                       <a href="{print_url}" class="icon 
icon-print" target="_blank">
                                                {print_text}
                                        </a>
                                        <a href="{home_url}" class="icon 
icon-home">

Modified: branches/dev-syncromind/phpgwapi/templates/pure/head.inc.php
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/pure/head.inc.php        
2015-12-06 12:45:08 UTC (rev 14533)
+++ branches/dev-syncromind/phpgwapi/templates/pure/head.inc.php        
2015-12-07 15:38:23 UTC (rev 14534)
@@ -7,9 +7,9 @@
        phpgw::import_class('phpgwapi.jquery');
        phpgwapi_jquery::load_widget('core');
 
-       phpgw::import_class('phpgwapi.yui');
-       phpgwapi_yui::load_widget('button');
-       phpgwapi_yui::load_widget('container');
+//     phpgw::import_class('phpgwapi.yui');
+//     phpgwapi_yui::load_widget('button');
+//     phpgwapi_yui::load_widget('container');
        $GLOBALS['phpgw_info']['server']['no_jscombine']=true;
        if( !$GLOBALS['phpgw_info']['flags']['noframework'] && 
!$GLOBALS['phpgw_info']['flags']['nonavbar'] )
        {
@@ -89,6 +89,27 @@
                        $GLOBALS['phpgw']->template->parse('javascripts', 
'javascript', true);
                }
        }
+
+       
switch($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'])
+       {
+               case 'portico':
+                       $selecte_portico = ' selected = "selected"';
+                       $selecte_pure = '';
+                       break;
+               case 'pure':
+                       $selecte_portico = '';
+                       $selecte_pure = ' selected = "selected"';
+                       break;
+       }
+
+       $template_selector = <<<HTML
+
+   <select id = "template_selector">
+       <option value="pure"{$selecte_pure}>Template 1</option>
+       <option value="portico"{$selecte_portico}>Template 2</option>
+   </select>
+HTML;
+
        $tpl_vars = array
        (
                'noheader'                                      => 
isset($GLOBALS['phpgw_info']['flags']['noheader_xsl']) && 
$GLOBALS['phpgw_info']['flags']['noheader_xsl'] ? 'true' : 'false',
@@ -101,6 +122,7 @@
                'webserver_url'                         => 
$GLOBALS['phpgw_info']['server']['webserver_url'],
                'win_on_events'                         => 
$GLOBALS['phpgw']->common->get_on_events(),
                'menu_stylesheet_widescreen'=> $menu_stylesheet_widescreen,
+               'template_selector'                     => $template_selector
        );
 
        $GLOBALS['phpgw']->template->set_var($tpl_vars);

Modified: branches/dev-syncromind/phpgwapi/templates/pure/js/mmenu.js
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/pure/js/mmenu.js 2015-12-06 
12:45:08 UTC (rev 14533)
+++ branches/dev-syncromind/phpgwapi/templates/pure/js/mmenu.js 2015-12-07 
15:38:23 UTC (rev 14534)
@@ -100,6 +100,25 @@
        });
 
 
+       $("#template_selector").change(function () {
+
+               var template = $(this).val();
+               //user[template_set] = template;
+               var oArgs = {appname: 'preferences', type: 'user'};
+               var requestUrl = phpGWLink('preferences/preferences.php', 
oArgs, true);
+
+               $.ajax({
+                       type: 'POST',
+                       dataType: 'json',
+                       data: {user: {template_set: template}, submit: true},
+                       url: requestUrl,
+                       success: function (data) {
+                               console.log(data);
+                               location.reload(true);
+                       }
+               });
+       });
+
 });    
 
 function update_bookmark_menu(bookmark_candidate){

Modified: branches/dev-syncromind/phpgwapi/templates/pure/navbar.tpl
===================================================================
--- branches/dev-syncromind/phpgwapi/templates/pure/navbar.tpl  2015-12-06 
12:45:08 UTC (rev 14533)
+++ branches/dev-syncromind/phpgwapi/templates/pure/navbar.tpl  2015-12-07 
15:38:23 UTC (rev 14534)
@@ -4,6 +4,7 @@
                        <div class="header">
                                <a id="hamburger" class="FixedTop" 
href="#menu"><span></span></a>
                                {current_app_title}
+                               {template_selector}
                        </div>
                        <div id="horizontal-menu">
                                        {topmenu}

Modified: branches/dev-syncromind/preferences/preferences.php
===================================================================
--- branches/dev-syncromind/preferences/preferences.php 2015-12-06 12:45:08 UTC 
(rev 14533)
+++ branches/dev-syncromind/preferences/preferences.php 2015-12-07 15:38:23 UTC 
(rev 14534)
@@ -45,7 +45,7 @@
                Header('Location: ' . 
$GLOBALS['phpgw']->link('/preferences/index.php') . "#$appname");
                exit;
        }
-       
+
        $user    = phpgw::get_var('user', 'string', 'POST');
        $forced  = phpgw::get_var('forced', 'string', 'POST');
        $default = phpgw::get_var('default', 'string', 'POST');




reply via email to

[Prev in Thread] Current Thread [Next in Thread]