From 938c991124abd65195fe198c2905e0c63faa08ef Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 19 Oct 2015 15:00:42 +0000 Subject: [PATCH] WIP Egroupware tutorial: - Create tutorial sidebox hooks automatically - Fix some styling for popup - Display intro video show confirmation dialog based on session (login/logout) --- .../inc/class.addressbook_hooks.inc.php | 1 - admin/inc/class.admin_hooks.inc.php | 1 - calendar/inc/class.calendar_ui.inc.php | 1 - etemplate/templates/default/egw_tutorial.xet | 2 +- .../inc/class.filemanager_hooks.inc.php | 1 - home/inc/class.home_tutorial_ui.inc.php | 8 +- home/setup/setup.inc.php | 1 + home/setup/tutorials.json | 89 +++++++++++++++++++ home/templates/default/tutorial.xet | 12 +-- infolog/inc/class.infolog_hooks.inc.php | 1 - mail/inc/class.mail_hooks.inc.php | 1 - phpgwapi/inc/class.hooks.inc.php | 6 +- phpgwapi/js/framework/fw_browser.js | 2 +- phpgwapi/js/jsapi/app_base.js | 15 ++-- phpgwapi/templates/default/def_tutorials.css | 6 ++ phpgwapi/templates/default/def_tutorials.less | 6 ++ pixelegg/css/mobile.css | 17 ++-- pixelegg/css/pixelegg.css | 8 +- pixelegg/less/layout_tutorials.css | 6 ++ resources/inc/class.resources_hooks.inc.php | 1 - 20 files changed, 149 insertions(+), 36 deletions(-) create mode 100644 home/setup/tutorials.json diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index 2b09aca310..3e09eb29ef 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -92,7 +92,6 @@ class addressbook_hooks display_sidebox($appname,lang('Admin'),$file); } } - hooks::egw_tutorial_menu('addressbook'); } /** diff --git a/admin/inc/class.admin_hooks.inc.php b/admin/inc/class.admin_hooks.inc.php index 0a55fe0326..bedf187916 100644 --- a/admin/inc/class.admin_hooks.inc.php +++ b/admin/inc/class.admin_hooks.inc.php @@ -154,7 +154,6 @@ class admin_hooks display_sidebox($appname,lang('Admin'),$file); } } - hooks::egw_tutorial_menu('admin'); } /** diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index f9ea33a999..c195efc2d8 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -621,7 +621,6 @@ class calendar_ui ); $GLOBALS['egw']->framework->sidebox($appname,lang('Admin'),$file,'admin'); } - hooks::egw_tutorial_menu('calendar'); } /** diff --git a/etemplate/templates/default/egw_tutorial.xet b/etemplate/templates/default/egw_tutorial.xet index 5a655a9a5b..c7d79c0349 100644 --- a/etemplate/templates/default/egw_tutorial.xet +++ b/etemplate/templates/default/egw_tutorial.xet @@ -9,7 +9,7 @@ - + diff --git a/filemanager/inc/class.filemanager_hooks.inc.php b/filemanager/inc/class.filemanager_hooks.inc.php index 70b2b8b69c..dc826ee2d1 100644 --- a/filemanager/inc/class.filemanager_hooks.inc.php +++ b/filemanager/inc/class.filemanager_hooks.inc.php @@ -94,7 +94,6 @@ class filemanager_hooks display_sidebox(self::$appname,$title,$file); } if ($GLOBALS['egw_info']['user']['apps']['admin']) self::admin(self::$appname); - hooks::egw_tutorial_menu('filemanager'); } /** diff --git a/home/inc/class.home_tutorial_ui.inc.php b/home/inc/class.home_tutorial_ui.inc.php index f9a0eef854..32c6f39693 100644 --- a/home/inc/class.home_tutorial_ui.inc.php +++ b/home/inc/class.home_tutorial_ui.inc.php @@ -75,6 +75,7 @@ class home_tutorial_ui { $content = array ( 'src' => $tutorial['src'], 'title' => $tutorial['title'], + 'desc' => $tutorial['desc'], 'list' => $list ); } @@ -83,11 +84,6 @@ class home_tutorial_ui { $content = array(); egw_framework::message(lang('You do not have permission to see this tutorial!')); } - // If its the autoloading tutorial - if ($tuid_indx[3] === 'a') - { - $content ['discardbox'] = true; - } $tmpl->exec('home.home_tutorial_ui.popup', $content,$sel_options,array(),array(),array(),2); } @@ -112,6 +108,8 @@ class home_tutorial_ui { if (!($json = egw_cache::getCache(egw_cache::TREE, 'home', 'egw_tutorial_json'))) { $json = file_get_contents('http://www.egroupware.de/videos/tutorials.json'); + // Fallback tutorials.json + if (!$json) $json = file_get_contents('home/setup/tutorials.json'); // Cache the json object for two hours egw_cache::setCache(egw_cache::TREE, 'home', 'egw_tutorial_json', $json, 720); } diff --git a/home/setup/setup.inc.php b/home/setup/setup.inc.php index da0729f0ec..7b4d98ef4b 100755 --- a/home/setup/setup.inc.php +++ b/home/setup/setup.inc.php @@ -27,6 +27,7 @@ $setup_info['home']['maintainer'] = array( /* The hooks this app includes, needed for hooks registration */ $setup_info['home']['hooks']['hasUpdates'] = 'home.updates.hasUpdates'; $setup_info['home']['hooks']['showUpdates'] = 'home.updates.showUpdates'; +$setup_info['home']['hooks']['sidebox_all'] = 'hooks::egw_tutorial_menu'; /* Dependencies for this app to work */ $setup_info['home']['depends'][] = array( diff --git a/home/setup/tutorials.json b/home/setup/tutorials.json new file mode 100644 index 0000000000..ca3879c5dd --- /dev/null +++ b/home/setup/tutorials.json @@ -0,0 +1,89 @@ +{ + "introduction":{ + "en":[ + {"src":"https://www.youtube.com/embed/iPrtjeEnXeU?rel=0&autoplay=1", "thumbnail":"https://img.youtube.com/vi/iPrtjeEnXeU/0.jpg", "title":"EGroupware Basics", "desc":"Some of EGroupwares most important basic features and functions in all apps."} + ] + }, + "mail":{ + "de":[ + {"src":"https://www.youtube.com/embed/wUdHb6Zha60?rel=0&autoplay=1","title":"EGroupware E-Mail Basics","thumbnail":"https://img.youtube.com/vi/wUdHb6Zha60/0.jpg", "desc":"Hier zeigen wir einige praktische Funktionen der Anwendung Mail. Beipiele: Benutzung des Kontextmenüs und Anpassen des Vorschaudialogs für Emails."}, + {"src":"https://www.youtube.com/embed/7DZKPKa_Rj0?rel=0&autoplay=1","title":"EGroupware E-Mail Account Management","thumbnail":"https://img.youtube.com/vi/7DZKPKa_Rj0/0.jpg", "desc":"In diesem Tutorial erklären wir, wie einfach Sie sich selbst einen neuen Mailaccount anlegen und wie schnell das geht."}, + {"src":"https://www.youtube.com/embed/vml4Ok1qdGM?rel=0&autoplay=1","title":"EGroupware Admin Mail","thumbnail":"https://img.youtube.com/vi/vml4Ok1qdGM/0.jpg", "desc":"Hier zeigen wir - für alle Admins - wichtige Einstellungen in EGroupware Mail!"}, + {"src":"https://www.youtube.com/embed/A_tkKYaW_iI?rel=0&autoplay=1","title":"EGroupware 14.2 neue Features","thumbnail":"https://img.youtube.com/vi/A_tkKYaW_iI/0.jpg", "desc":"In diesem Video werden die drei wichtigsten Neuerungen der neuen EGroupware Version 14.2. beschrieben."} + ], + "en":[ + {"src":"https://www.youtube.com/embed/5ukeZd-kEMo?rel=0&autoplay=1","title":"EGroupware E-Mail Basics","thumbnail":"https://img.youtube.com/vi/5ukeZd-kEMo/0.jpg", "desc":"Here we show some useful features of mail application. E.g. we explain how to use context menu or how you can customize preview dialog."}, + {"src":"https://www.youtube.com/embed/LkWOL8PkgvU?rel=0&autoplay=1","title":"EGroupware E-Mail account management","thumbnail":"https://img.youtube.com/vi/LkWOL8PkgvU/0.jpg", "desc":"In this tutorial we explain, how fast and how easy you create your own mail account."}, + {"src":"https://www.youtube.com/embed/8CTF7w3K8kA?rel=0&autoplay=1","title":"EGroupware Admin Mail","thumbnail":"https://img.youtube.com/vi/8CTF7w3K8kA/0.jpg", "desc":"We show, how you – as an admin – change settings for one user in Stylite Mail Hosting."}, + {"src":"https://www.youtube.com/embed/mCDJndpjO40?rel=0&autoplay=1","title":"EGroupware 14.2 new features","thumbnail":"https://img.youtube.com/vi/mCDJndpjO40/0.jpg", "desc":"This video shows the three main features of upcoming new EGroupware version 14.2."} + ] + }, + "admin":{ + "de":[ + {"src":"https://www.youtube.com/embed/a-VYyo7rQxA?rel=0&autoplay=1","title":"EGroupware Admin Basics","thumbnail":"https://img.youtube.com/vi/a-VYyo7rQxA/0.jpg", "desc":"Grundlagen der EGroupware Administration: Benutzer und Gruppen anlegen, Kategorien anlegen, Zugriffsrechte vergeben und benutzerdefinierte Felder erstellen."}, + {"src":"https://www.youtube.com/embed/vml4Ok1qdGM?rel=0&autoplay=1","title":"EGroupware Admin Mail","thumbnail":"https://img.youtube.com/vi/vml4Ok1qdGM/0.jpg", "desc":"Hier zeigen wir - für alle Admins - wichtige Einstellungen in EGroupware Mail!"}, + {"src":"https://www.youtube.com/embed/7DZKPKa_Rj0?rel=0&autoplay=1","title":"EGroupware E-Mail Account Management","thumbnail":"https://img.youtube.com/vi/7DZKPKa_Rj0/0.jpg", "desc":"In diesem Tutorial erklären wir, wie einfach Sie sich selbst einen neuen Mailaccount anlegen und wie schnell das geht."}, + {"src":"https://www.youtube.com/embed/e_X2InMcBao?rel=0&autoplay=1","title":"EGroupware Synchronisation - Apple","thumbnail":"https://img.youtube.com/vi/e_X2InMcBao/0.jpg", "desc":"In diesem Video erklären wir Schritt für Schritt die Synchronisation mit Ihrem Mobilgerät - für alle Apple-Geräte."}, + {"src":"https://www.youtube.com/embed/hJWQYzxC9MA?rel=0&autoplay=1","title":"EGroupware Synchronisation - Android","thumbnail":"https://img.youtube.com/vi/hJWQYzxC9MA/0.jpg", "desc":"In diesem Video erklären wir Schritt für Schritt die Synchronisation mit Ihrem Mobilgerät - für alle Android-Geräte."} + ], + "en":[ + {"src":"https://www.youtube.com/embed/W0q2HyT6tQU?rel=0&autoplay=1","title":"EGroupware Admin Basics","thumbnail":"https://img.youtube.com/vi/W0q2HyT6tQU/0.jpg", "desc":"Basics of EGroupware Administration: create users and groups, add categories, define access rights and custom fields."}, + {"src":"https://www.youtube.com/embed/8CTF7w3K8kA?rel=0&autoplay=1","title":"EGroupware Admin Mail","thumbnail":"https://img.youtube.com/vi/8CTF7w3K8kA/0.jpg", "desc":"We show, how you – as an admin – change settings for one user in Stylite Mail Hosting."}, + {"src":"https://www.youtube.com/embed/LkWOL8PkgvU?rel=0&autoplay=1","title":"EGroupware E-Mail account management","thumbnail":"https://img.youtube.com/vi/LkWOL8PkgvU/0.jpg", "desc":"In this tutorial we explain, how fast and how easy you create your own mail account."}, + {"src":"https://www.youtube.com/embed/hHxjjQ_MqnY?rel=0&autoplay=1","title":"EGroupware Synchronisation - Apple","thumbnail":"https://img.youtube.com/vi/hHxjjQ_MqnY/0.jpg", "desc":"We explain step by step, how to synchronise EGroupware with your smartphone or tablet - for all Apple devices."}, + {"src":"https://www.youtube.com/embed/-NdgyI7BDpY?rel=0&autoplay=1","title":"EGroupware Synchronisation - Android","thumbnail":"https://img.youtube.com/vi/-NdgyI7BDpY/0.jpg", "desc":"We explain step by step, how to synchronise EGroupware with your smartphone or tablet - for all Android devices."} + ] + + }, + + "filemanager":{ + "de":[ + {"src":"https://www.youtube.com/embed/scB_l7OjdJI?rel=0&autoplay=1","title":"EGroupware Dateimanager","thumbnail":"https://img.youtube.com/vi/scB_l7OjdJI/0.jpg", "desc":"In diesem Tutorial gibt es praktische Tipps und Erklärungen zur Nutzung des Dateimanagers."}, + {"src":"https://www.youtube.com/embed/A_tkKYaW_iI?rel=0&autoplay=1","title":"EGroupware 14.2 neue Features","thumbnail":"https://img.youtube.com/vi/A_tkKYaW_iI/0.jpg", "desc":"In diesem Video werden die drei wichtigsten Neuerungen der neuen EGroupware Version 14.2. beschrieben."} + ], + "en":[ + {"src":"https://www.youtube.com/embed/lOR3vo6hMwA?rel=0&autoplay=1","title":"EGroupware File Manager","thumbnail":"https://img.youtube.com/vi/lOR3vo6hMwA/0.jpg", "desc":"We here give some useful tips concerning the usage of filemanager. We talk about handling and usability and the new sharing options that are available with version 14.2."}, + {"src":"https://www.youtube.com/embed/mCDJndpjO40?rel=0&autoplay=1","title":"EGroupware 14.2 new features","thumbnail":"https://img.youtube.com/vi/mCDJndpjO40/0.jpg", "desc":"This video shows the three main features of upcoming new EGroupware version 14.2."} + ] + }, + "infolog":{ + "de":[ + {"src":"https://www.youtube.com/embed/fiPjk49HtMY?rel=0&autoplay=1","title":"EGroupware - CRM","thumbnail":"https://img.youtube.com/vi/fiPjk49HtMY/0.jpg", "desc":"Customer Relationship Management - Hier zeigen wir, wie Kontakte und Termine von Kunden oder Partnern mit Adressbuch, Kalender und InfoLog abgebildet werden können."}, + {"src":"https://www.youtube.com/embed/A_tkKYaW_iI?rel=0&autoplay=1","title":"EGroupware 14.2 neue Features","thumbnail":"https://img.youtube.com/vi/A_tkKYaW_iI/0.jpg", "desc":"In diesem Video werden die drei wichtigsten Neuerungen der neuen EGroupware Version 14.2. beschrieben."} + ], + "en":[ + {"src":"https://www.youtube.com/embed/HwjZFnitqRQ?rel=0&autoplay=1","title":"EGroupware - CRM","thumbnail":"https://img.youtube.com/vi/HwjZFnitqRQ/0.jpg", "desc":"Customer Relationship Management - We show, how contacts and events of customers or partners can be edited with Addressbook, Calendar and InfoLog."}, + {"src":"https://www.youtube.com/embed/mCDJndpjO40?rel=0&autoplay=1","title":"EGroupware 14.2 new features","thumbnail":"https://img.youtube.com/vi/mCDJndpjO40/0.jpg", "desc":"This video shows the three main features of upcoming new EGroupware version 14.2."} + ] + }, + "calendar":{ + "de":[ + {"src":"https://www.youtube.com/embed/fiPjk49HtMY?rel=0&autoplay=1","title":"EGroupware - CRM","thumbnail":"https://img.youtube.com/vi/fiPjk49HtMY/0.jpg", "desc":"Customer Relationship Management - Hier zeigen wir, wie Kontakte und Termine von Kunden oder Partnern mit Adressbuch, Kalender und InfoLog abgebildet werden können."}, + {"src":"https://www.youtube.com/embed/rP_fK7Dk42s?rel=0&autoplay=1","title":"EGroupware für Universitäten und Schulen ","thumbnail":"https://img.youtube.com/vi/rP_fK7Dk42s/0.jpg", "desc":"Die EGroupware Ressourcen-Verwaltung ersetzt einzelne Listen und Aushänge und kann den Verleih von Beamern oder Laptops sowie die Nutzung von Sportplatz oder Sitzungssaal übersichtlich abbilden."} + ], + "en":[ + {"src":"https://www.youtube.com/embed/HwjZFnitqRQ?rel=0&autoplay=1","title":"EGroupware - CRM","thumbnail":"https://img.youtube.com/vi/HwjZFnitqRQ/0.jpg", "desc":"Customer Relationship Management - We show, how contacts and events of customers or partners can be edited with Addressbook, Calendar and InfoLog."} + ] + }, + "home":{ + "de":[ + {"src":"https://www.youtube.com/embed/A_tkKYaW_iI?rel=0&autoplay=1","title":"EGroupware 14.2 neue Features","thumbnail":"https://img.youtube.com/vi/A_tkKYaW_iI/0.jpg", "desc":"In diesem Video werden die drei wichtigsten Neuerungen der neuen EGroupware Version 14.2. beschrieben."} + ], + "en":[ + {"src":"https://www.youtube.com/embed/mCDJndpjO40?rel=0&autoplay=1","title":"EGroupware 14.2 new features","thumbnail":"https://img.youtube.com/vi/mCDJndpjO40/0.jpg", "desc":"This video shows the three main features of upcoming new EGroupware version 14.2."} + ] + }, + "ressources":{ + "de":[ + {"src":"https://www.youtube.com/embed/rP_fK7Dk42s?rel=0&autoplay=1","title":"EGroupware für Universitäten und Schulen ","thumbnail":"https://img.youtube.com/vi/rP_fK7Dk42s/0.jpg", "desc":"Die EGroupware Ressourcen-Verwaltung ersetzt einzelne Listen und Aushänge und kann den Verleih von Beamern oder Laptops sowie die Nutzung von Sportplatz oder Sitzungssaal übersichtlich abbilden."} + ] + }, + "addressbook":{ + "de":[ + {"src":"https://www.youtube.com/embed/0JqoFhAGLwo?rel=0&autoplay=1","title":"EGroupware Basics","thumbnail":"https://img.youtube.com/vi/0JqoFhAGLwo/0.jpg", "desc":"Die wichtigsten Basics von EGroupware und die grundlegenden Funktionen der Software."} + ], + "en":[ + {"src":"https://www.youtube.com/embed/iPrtjeEnXeU?rel=0&autoplay=1","title":"EGroupware Basics","thumbnail":"https://img.youtube.com/vi/iPrtjeEnXeU/0.jpg", "desc":"Some of EGroupwares most important basic features and functions in all apps."} + ] + } +} \ No newline at end of file diff --git a/home/templates/default/tutorial.xet b/home/templates/default/tutorial.xet index d05f5adac7..1f6689d4e3 100644 --- a/home/templates/default/tutorial.xet +++ b/home/templates/default/tutorial.xet @@ -4,8 +4,8 @@