This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lmce_owncloud [2014/06/09 21:13] – [The Auth app] admin | lmce_owncloud [2014/06/10 11:47] (current) – admin | ||
|---|---|---|---|
| Line 33: | Line 33: | ||
| vlc -vvv file:/// | vlc -vvv file:/// | ||
| | | ||
| - | ===== Useful | + | ===== Useful |
| ==== PHP ==== | ==== PHP ==== | ||
| + | Add Settings in admin area (appinfo/ | ||
| + | |||
| + | <code php> | ||
| + | \OCP\App:: | ||
| + | </ | ||
| + | |||
| + | Get users ID: | ||
| + | |||
| + | <code php> | ||
| + | OCP\User:: | ||
| + | </ | ||
| + | |||
| + | Translate in Template | ||
| + | |||
| + | <code php> | ||
| + | <?php echo $l-> | ||
| + | </ | ||
| + | |||
| + | Check for logged in user: | ||
| + | |||
| + | <code php> | ||
| + | OCP\JSON:: | ||
| + | </ | ||
| + | |||
| + | Check for enabled app: | ||
| + | |||
| + | <code php> | ||
| + | OCP\JSON:: | ||
| + | </ | ||
| ==== Javascript ==== | ==== Javascript ==== | ||
| + | Include JS (appinfo/ | ||
| + | |||
| + | <code php> | ||
| + | OCP\Util:: | ||
| + | </ | ||
| + | |||
| + | Includes file app_folder/ | ||
| + | |||
| + | Translate: | ||
| + | |||
| + | <code javascript> | ||
| + | t(' | ||
| + | </ | ||
| + | |||
| + | Select a File: | ||
| + | |||
| + | <code javascript> | ||
| + | OC.dialogs.filepicker(' | ||
| + | </ | ||
| + | |||
| + | AJAX URL: | ||
| + | |||
| + | <code javascript> | ||
| + | OC.filePath(' | ||
| + | </ | ||
| + | |||
| + | Example AJAX request: | ||
| + | |||
| + | <code javascript> | ||
| + | $.ajax({ | ||
| + | // REQUEST URL | ||
| + | url: OC.filePath(' | ||
| + | type: " | ||
| + | // URL PARAMS | ||
| + | data: { action: action}, | ||
| + | success: function(data){ | ||
| + | // DO SOMETHING WITH data | ||
| + | }, | ||
| + | error: function(data){ | ||
| + | alert(' | ||
| + | }, | ||
| + | }); | ||
| + | </ | ||
| + | |||
| + | ==== CSS ==== | ||
| + | |||
| + | |||
| + | Include CSS (appinfo/ | ||
| + | |||
| + | <code php> | ||
| + | OCP\Util:: | ||
| + | </ | ||
| + | |||
| + | Includes file app_folder/ | ||
| + | |||
| + | |||
| + | Get file app folder using **%appswebroot%**: | ||
| + | |||
| + | <code css> | ||
| + | #someId { | ||
| + | background: | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Good to know vars in JS: | ||
| + | |||
| + | <code javascript> | ||
| + | oc_debug=false; | ||
| + | oc_webroot="/ | ||
| + | oc_appswebroots={" | ||
| + | dayNames=[" | ||
| + | var monthNames=[" | ||
| + | var firstDay=0; | ||
| + | var oc_config={" | ||
| + | </ | ||