App settings
parent
243c6c56d2
commit
0d6d3a5d22
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Office App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Office;
|
||||
|
||||
\OCP\JSON::callCheck();
|
||||
|
||||
$unstable = isset($_POST['unstable']) ? $_POST['unstable'] : null;
|
||||
if (!is_null($unstable)){
|
||||
\OCP\JSON::checkAdminUser();
|
||||
\OCP\Config::setAppValue('office', 'unstable', $unstable);
|
||||
\OCP\JSON::success();
|
||||
exit();
|
||||
}
|
||||
|
||||
if (isset($_GET['unstable'])){
|
||||
\OCP\JSON::success(array(
|
||||
'value' => \OCP\Config::getAppValue('office', 'unstable', 'false')
|
||||
));
|
||||
}
|
||||
exit();
|
@ -0,0 +1,16 @@
|
||||
$(document).ready(function(){
|
||||
$('#appsettings_popup').wrap('<div id="office-appsettings"></div>');
|
||||
|
||||
var officeSettings = {
|
||||
save : function() {
|
||||
var data = {
|
||||
unstable : $('#webodf-unstable').attr('checked')==="checked"
|
||||
};
|
||||
$.post(OC.filePath('office', 'ajax', 'settings.php'), data, officeSettings.afterSave);
|
||||
},
|
||||
afterSave : function(){
|
||||
officeMain.useUnstable = $('#webodf-unstable').attr('checked')==="checked"
|
||||
}
|
||||
};
|
||||
$('#webodf-unstable').change(officeSettings.save);
|
||||
});
|
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Office App
|
||||
*
|
||||
* @author Victor Dubiniuk
|
||||
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Office;
|
||||
|
||||
$tmpl = new \OCP\Template('office', 'settings');
|
||||
$tmpl->assign('unstable', false);
|
||||
$tmpl->printPage();
|
@ -0,0 +1,10 @@
|
||||
<ul>
|
||||
<li>
|
||||
<input id="webodf-unstable" type ="checkbox"
|
||||
<?php if (\OCP\Config::getAppValue('office', 'unstable', 'false') === 'true'){?>
|
||||
checked="checked"
|
||||
<?php } ?>
|
||||
value="<?php p($_['unstable']); ?>" />
|
||||
<label for="webodf-unstable"><?php p($l->t('Unstable WebODF Features')); ?></label>
|
||||
</li>
|
||||
</ul>
|
Loading…
Reference in New Issue