User Tools

Site Tools


lmce_owncloud

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lmce_owncloud [2014/06/09 21:24] – [Javascript] adminlmce_owncloud [2014/06/10 11:47] (current) admin
Line 33: Line 33:
   vlc -vvv file:///mnt/device/61/sadasdasd.avi --sout="#transcode{vcodec=theo, vb=800, acodec=vorb, ab=128, scale=1, audio-sync, width=480, height=320}:std{access=http, mux=ogg, dst='192.168.1.210:9080/streaming/test/106.ogg' }"   vlc -vvv file:///mnt/device/61/sadasdasd.avi --sout="#transcode{vcodec=theo, vb=800, acodec=vorb, ab=128, scale=1, audio-sync, width=480, height=320}:std{access=http, mux=ogg, dst='192.168.1.210:9080/streaming/test/106.ogg' }"
      
-===== Useful commands for app development =====+===== Useful code for app development =====
 ==== PHP ==== ==== PHP ====
 +
 +Add Settings in admin area (appinfo/app.php):
 +
 +<code php>
 +\OCP\App::registerAdmin('lmce_vdr', 'admin/settings');
 +</code>
 +
 +Get users ID:
 +
 +<code php>
 +OCP\User::getUser();
 +</code>
  
 Translate in Template Translate in Template
Line 40: Line 52:
 <code php> <code php>
 <?php echo $l->t('Channel manager'); ?> <?php echo $l->t('Channel manager'); ?>
 +</code>
 +
 +Check for logged in user:
 +
 +<code php>
 +OCP\JSON::checkLoggedIn();
 +</code>
 +
 +Check for enabled app:
 +
 +<code php>
 +OCP\JSON::checkAppEnabled('lmce_vdr');
 </code> </code>
 ==== Javascript ==== ==== Javascript ====
 +
 +Include JS (appinfo/app.php):
 +
 +<code php>
 +OCP\Util::addscript('lmce_vdr','script');
 +</code>
 +
 +Includes file app_folder/js/script.js
  
 Translate: Translate:
Line 54: Line 86:
 OC.dialogs.filepicker('test', function(val) {console.log(val)}, true, null, true); OC.dialogs.filepicker('test', function(val) {console.log(val)}, true, null, true);
 </code> </code>
- 
- 
  
 AJAX URL: AJAX URL:
Line 63: Line 93:
 </code> </code>
  
 +Example AJAX request:
 +
 +<code javascript>
 +$.ajax({
 + // REQUEST URL
 + url: OC.filePath('lmce_vdr','ajax','action.php'),
 + type: "post",
 + // URL PARAMS
 + data: { action: action},
 + success: function(data){
 + // DO SOMETHING WITH data
 + },
 + error: function(data){
 + alert('Error running action ...');
 + },
 +});
 +</code>
  
 ==== CSS ==== ==== CSS ====
 +
 +
 +Include CSS (appinfo/app.php):
 +
 +<code php>
 +OCP\Util::addStyle("lmce_vdr", "style");
 +</code>
 +
 +Includes file app_folder/css/style.css
 +
  
 Get file app folder using **%appswebroot%**: Get file app folder using **%appswebroot%**:
Line 72: Line 129:
   background:url(%appswebroot%/lmce_vdr/img/textfield-rename.png)   background:url(%appswebroot%/lmce_vdr/img/textfield-rename.png)
 } }
 +</code>
 +
 +Good to know vars in JS:
 +
 +<code javascript>0
 +oc_debug=false;
 +oc_webroot="/userspace";
 +oc_appswebroots={"files":"/userspace/apps/files","activity":"/userspace/apps/activity","calendar":"/userspace/apps/calendar","contacts":"/userspace/apps/contacts"}datepickerFormatDate="dd.mm.yy";
 +dayNames=["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"];
 +var monthNames=["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];
 +var firstDay=0;
 +var oc_config={"session_lifetime":"144000","session_keepalive":true};
 </code> </code>
lmce_owncloud.1402349054.txt.gz · Last modified: 2014/06/09 21:24 by admin