Add extra option to disable doc(x) support
This commit is contained in:
parent
a25b2a90e8
commit
849bbe5be7
@ -37,7 +37,8 @@ OCP\App::addNavigationEntry(array(
|
|||||||
//Script for registering file actions
|
//Script for registering file actions
|
||||||
OCP\Util::addScript('documents', 'viewer/viewer');
|
OCP\Util::addScript('documents', 'viewer/viewer');
|
||||||
|
|
||||||
$docFilter = new OCA\Documents\Filter\Office(
|
if (OCA\Documents\Config::getConverter() !== 'off'){
|
||||||
|
$docFilter = new OCA\Documents\Filter\Office(
|
||||||
array(
|
array(
|
||||||
'read' =>
|
'read' =>
|
||||||
array (
|
array (
|
||||||
@ -69,7 +70,8 @@ $docxFilter = new OCA\Documents\Filter\Office(
|
|||||||
'extension' => 'docx'
|
'extension' => 'docx'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//Listen to delete file signal
|
//Listen to delete file signal
|
||||||
OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Documents\Storage", "onDelete");
|
OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Documents\Storage", "onDelete");
|
||||||
|
@ -97,7 +97,8 @@ class SettingsController extends Controller{
|
|||||||
'data' => array('message' => (string) $this->l10n->t('Saved'))
|
'data' => array('message' => (string) $this->l10n->t('Saved'))
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->settings->getAppValue($this->appName, 'converter', 'local') != 'local'){
|
$currentConverter = $this->settings->getAppValue($this->appName, 'converter', 'off');
|
||||||
|
if ($currentConverter == 'external'){
|
||||||
if (!Converter::checkConnection()){
|
if (!Converter::checkConnection()){
|
||||||
$this->logger->warning('Bad response from Format Filter Server', array('app' => $this->appName));
|
$this->logger->warning('Bad response from Format Filter Server', array('app' => $this->appName));
|
||||||
$response = array(
|
$response = array(
|
||||||
@ -106,7 +107,7 @@ class SettingsController extends Controller{
|
|||||||
array('message' => (string) $this->l10n->t('Format filter server is down or misconfigured') )
|
array('message' => (string) $this->l10n->t('Format filter server is down or misconfigured') )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} elseif ($currentConverter === 'local') {
|
||||||
try {
|
try {
|
||||||
if (!Config::testConversion()){
|
if (!Config::testConversion()){
|
||||||
$response = array(
|
$response = array(
|
||||||
|
@ -9,7 +9,7 @@ $(document).ready(function(){
|
|||||||
converter : $('[name="docs_converter"]:checked').val()
|
converter : $('[name="docs_converter"]:checked').val()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (data.converter !== 'local'){
|
if (data.converter === 'external'){
|
||||||
data.url = $('#docs_url').val();
|
data.url = $('#docs_url').val();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,8 +27,8 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$('#docs_converter_external, #docs_converter_local').on('click', function(){
|
$('#docs_converter_external, #docs_converter_local, #docs_converter_off').on('click', function(){
|
||||||
$('#docs_extra').toggle($('[name="docs_converter"]:checked').val() !== 'local');
|
$('#docs_extra').toggle($('[name="docs_converter"]:checked').val() === 'external');
|
||||||
});
|
});
|
||||||
$('#docs_apply').on('click', documentsSettings.save);
|
$('#docs_apply').on('click', documentsSettings.save);
|
||||||
});
|
});
|
||||||
|
@ -49,7 +49,7 @@ class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function getConverter(){
|
public static function getConverter(){
|
||||||
return self::getAppValue('converter', 'local');
|
return self::getAppValue('converter', 'off');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setConverter($value){
|
public static function setConverter($value){
|
||||||
|
@ -1,22 +1,28 @@
|
|||||||
<?php $isLocal = $_['converter']=='local' ?>
|
|
||||||
<div class="section" id="documents">
|
<div class="section" id="documents">
|
||||||
<h2><?php p($l->t('Documents')) ?></h2>
|
<h2><?php p($l->t('Documents')) ?></h2>
|
||||||
<p><?php p($l->t('MS Word support (requires openOffice/libreOffice)')) ?></p>
|
<p><?php p($l->t('MS Word support (requires openOffice/libreOffice)')) ?></p>
|
||||||
<p>
|
<p>
|
||||||
<input type="radio" name="docs_converter" value="local" id="docs_converter_local"
|
<input type="radio" name="docs_converter" value="local" id="docs_converter_local"
|
||||||
<?php print_unescaped($isLocal ? 'checked="checked"' : '') ?>
|
<?php print_unescaped($_['converter']=='local' ? 'checked="checked"' : '') ?>
|
||||||
/>
|
/>
|
||||||
<label for="docs_converter_local"><?php p($l->t('Local')) ?></label><br>
|
<label for="docs_converter_local"><?php p($l->t('Local')) ?></label><br>
|
||||||
<em><?php p($l->t('openOffice/libreOffice is installed on this server. Path to binary is provided via preview_libreoffice_path in config.php')) ?></em>
|
<em><?php p($l->t('openOffice/libreOffice is installed on this server. Path to binary is provided via preview_libreoffice_path in config.php')) ?></em>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<input type="radio" name="docs_converter" value="external" id="docs_converter_external"
|
<input type="radio" name="docs_converter" value="external" id="docs_converter_external"
|
||||||
<?php print_unescaped(!$isLocal ? 'checked="checked"' : '') ?>
|
<?php print_unescaped($_['converter']=='external' ? 'checked="checked"' : '') ?>
|
||||||
/>
|
/>
|
||||||
<label for="docs_converter_external"><?php p($l->t('External')) ?></label><br>
|
<label for="docs_converter_external"><?php p($l->t('External')) ?></label><br>
|
||||||
<em><?php p($l->t('openOffice/libreOffice is installed on external server running a format filter server')) ?></em>
|
<em><?php p($l->t('openOffice/libreOffice is installed on external server running a format filter server')) ?></em>
|
||||||
</p>
|
</p>
|
||||||
<div id="docs_extra" <?php print_unescaped($isLocal ? 'style="display:none"' : '') ?>>
|
<p>
|
||||||
|
<input type="radio" name="docs_converter" value="off" id="docs_converter_off"
|
||||||
|
<?php print_unescaped($_['converter']=='off' ? 'checked="checked"' : '') ?>
|
||||||
|
/>
|
||||||
|
<label for="docs_converter_off"><?php p($l->t('Disabled')) ?></label><br>
|
||||||
|
<em><?php p($l->t('No MS Word support')) ?></em>
|
||||||
|
</p>
|
||||||
|
<div id="docs_extra" <?php print_unescaped($_['converter']!=='external' ? 'style="display:none"' : '') ?>>
|
||||||
<input type="text" name="docs_url" id="docs_url"
|
<input type="text" name="docs_url" id="docs_url"
|
||||||
value="<?php p($_['converter_url'])?>"
|
value="<?php p($_['converter_url'])?>"
|
||||||
original-title="<?php p($l->t('scheme://domain.tld[:port]')) ?>"
|
original-title="<?php p($l->t('scheme://domain.tld[:port]')) ?>"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user