From ea1a60743d74e079a9c88a829a666d1a2a72c90d Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sun, 11 Nov 2012 16:48:37 +0000 Subject: [PATCH] formular for webapp 1.0 finished (not working with 1.2 due to api changes...) --- .project | 11 ++ config.php | 7 + js/calendarimporter.js | 217 +++++++++++++++++++++++++++++ manifest.xml | 31 +++++ php/plugin.calendarimporter.php | 58 ++++++++ resources/css/calendarimporter.css | 6 + resources/images/import_icon.png | Bin 0 -> 3153 bytes 7 files changed, 330 insertions(+) create mode 100644 .project create mode 100644 config.php create mode 100644 js/calendarimporter.js create mode 100644 manifest.xml create mode 100644 php/plugin.calendarimporter.php create mode 100644 resources/css/calendarimporter.css create mode 100644 resources/images/import_icon.png diff --git a/.project b/.project new file mode 100644 index 0000000..c511de9 --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + calendarimporter + + + + + + + + diff --git a/config.php b/config.php new file mode 100644 index 0000000..4cd6fbd --- /dev/null +++ b/config.php @@ -0,0 +1,7 @@ + diff --git a/js/calendarimporter.js b/js/calendarimporter.js new file mode 100644 index 0000000..21a630f --- /dev/null +++ b/js/calendarimporter.js @@ -0,0 +1,217 @@ +/*############################################################################################################################ + * IMPORT PANEL + *############################################################################################################################*/ +Ext.namespace("Zarafa.plugins.calendarimporter"); // Assign the right namespace +Zarafa.plugins.calendarimporter.ImportPanel = Ext.extend(Ext.form.FormPanel, { + constructor: function (a) { + a = a || {}; + var b = this; + Ext.apply(a, { + xtype: "calendarimporter.ImportPanel", + layout: { + type: "form", + align: "stretch" + }, + anchor: "100%", + bodyStyle: "background-color: inherit;", + defaults: { + border: true, + bodyStyle: "background-color: inherit; padding: 3px 0px 3px 0px; border-style: none none solid none;" + }, + items: [this.createSelectBox(), this.createUploadField(), this.createSubmitButton(), this.createCancelButton()] + }); + Zarafa.plugins.calendarimporter.ImportPanel.superclass.constructor.call(this, a) + }, + createSelectBox: function() { + ctx = container.getContextByName('calendar'); + model = ctx.getModel(); + defaultFolder = model.getDefaultFolder(); + subFolders = defaultFolder.getChildren(); + + var myStore = new Ext.data.ArrayStore({ + fields: ['calendar_id', 'calendar_displayname'], + idIndex: 0 // id for each record will be the first element + }); + + /* Calendar Record holds the name and real name of the calender */ + var CalendarRecord = Ext.data.Record.create([ + {name: 'realname', type: "string"}, + {name: 'displayname', type: "string"} + ]); + + /* Store the default folder */ + var myNewRecord = new CalendarRecord({ + realname: defaultFolder.getDefaultFolderKey(), + displayname: defaultFolder.getDisplayName() + }); + myStore.add(myNewRecord); + + for(i=0;i + + + + 0.1 + calendarimporter + ICS Calendar Importer + Christoph Haas + http://www.sprinternet.at + Import a ICS file to the zarafa calendar + + + config.php + + + + + + php/plugin.calendarimporter.php + + + js/calendarimporter.js + js/calendarimporter.js + + + resources/css/calendarimporter.css + + + + + diff --git a/php/plugin.calendarimporter.php b/php/plugin.calendarimporter.php new file mode 100644 index 0000000..5b47b31 --- /dev/null +++ b/php/plugin.calendarimporter.php @@ -0,0 +1,58 @@ +registerHook('server.core.settings.init.before'); + } + + /** + * Function is executed when a hook is triggered by the PluginManager + * + * @param string $eventID the id of the triggered hook + * @param mixed $data object(s) related to the hook + * @return void + */ + function execute($eventID, &$data) { + switch($eventID) { + case 'server.core.settings.init.before' : + $this->injectPluginSettings($data); + break; + } + } + + /** + * Called when the core Settings class is initialized and ready to accept sysadmin default + * settings. + * @param Array $data Reference to the data of the triggered hook + */ + function injectPluginSettings(&$data) { + $data['settingsObj']->addSysAdminDefaults(Array( + 'zarafa' => Array( + 'v1' => Array( + 'plugins' => Array( + 'calendarimporter' => Array( + 'enable' => PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE, + 'default_calendar' => PLUGIN_CALENDARIMPORTER_DEFAULT + ) + ) + ) + ) + )); + } +} +?> diff --git a/resources/css/calendarimporter.css b/resources/css/calendarimporter.css new file mode 100644 index 0000000..d3d595a --- /dev/null +++ b/resources/css/calendarimporter.css @@ -0,0 +1,6 @@ +.icon_calendarimporter_button { + background: url(../images/import_icon.png) no-repeat !important; + background-repeat: no-repeat; + background-position: center; + background-size: 18px!important; +} \ No newline at end of file diff --git a/resources/images/import_icon.png b/resources/images/import_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..db81205019d2ccd99a33f52d9ba9b2bde4fcf86b GIT binary patch literal 3153 zcmc&$XH-*N77a)VMUW;^6i}LtBGRRrXaEg@G*J*R(xeC~@~J>X5JEHb-g~4<4In*q zkRHH<7J?KZgkH_OnQzUk`8oe)ul3%&XWx6y*?YbF*1D(%@Vlp31zABL&}lsw#26S6 z|9rrwfcM>7&+S1VdfNy0OrSs*8X6iA5s{ghnUj-KTU*=K))o>H@;8&4oBRFy_vYs2 zjEoFm4)9@NVU3NA00YdweE9-oWoKvS=jYeg*8>b1jgECd4x3{maufM;4U|`_Kj~|1BgF{0@!^6WP zBO{}uqhn)Z<>lp-m6g@i)!)B=udS`Eudh=ml#PuIDwVpqxw*BqwY|N)v$M0i zySulyx4*xCaBy&VczASlbbNe#a&q$L&mS6%hQGbn030&Y*T(RNASM7{@GStE+Sb-K zHgq}%bpnHx)vdmaM4Fa*~>p^r(9H-YTonGQmpZ3n3|;H1Zk0IN7+nL~}b$(K(U5Ioeqw_hLFISSL%b zZ!D=l4E=FW3W|zDjBT5W^6Aon!P<0Ua#H?R{SMS57Vsn7PT#+UdPO>uYXeX6)env+ zeb52nE0idYdlhPd^vH~ZC65iMdF%K^j~7la=Phrubo-dlfjT_y8H2zdZH6w;)2k*L zHSnC$M#yxC*^5S~7n?~%go|}0cnH^X`oW$GU4^}SBAt{#4~n5<4IK9grh|#wxoBr< z6PUxVj-r~fw2uOci#N?KBHGoGGwK7yMK4Aks6~?EdG#$DVj0EGx#N>mDr3M#pMz@T zTpjfh*Yamni;eU-jAk$+L6+0Yvlj=M+2$@Rfi6boEabT6<^cbpx=A^ja}(-fft{@> z2czX7;;f1`W*ic3E;Xakmci5*)SIMzMud&G&zR%g%tz9!;(VR+WQ%T{it_En>Dw;DYJL(Y%B5 z5g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