mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
replace more output with methods()
This commit is contained in:
parent
9db601e610
commit
0f6da660e6
|
@ -31,9 +31,26 @@ require_once("class.Bootstrap.php");
|
||||||
*/
|
*/
|
||||||
class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
|
class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
protected function showTextField($name, $value, $type='', $placeholder='') { /* {{{ */
|
protected function showPaneHeader($name, $title, $isactive) { /* {{{ */
|
||||||
|
echo '<li class="'.($isactive ? 'active' : '').'"><a data-target="#'.$name.'" data-toggle="tab">'.$title.'</a></li>'."\n";
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
protected function showStartPaneContent($name, $isactive) { /* {{{ */
|
||||||
|
echo '<div class="tab-pane'.($isactive ? ' active' : '').'" id="'.$name.'">';
|
||||||
|
$this->contentContainerStart();
|
||||||
|
echo '<table class="table-condensed">';
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
protected function showEndPaneContent($name, $currentab) { /* {{{ */
|
||||||
|
echo '</table>';
|
||||||
|
$this->contentContainerEnd();
|
||||||
|
echo '</div>';
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
protected function getTextField($name, $value, $type='', $placeholder='') { /* {{{ */
|
||||||
|
$html = '';
|
||||||
if($type != 'password' && strlen($value) > 80)
|
if($type != 'password' && strlen($value) > 80)
|
||||||
echo '<textarea class="input-xxlarge" name="'.$name.'">'.$value.'</textarea>';
|
$html .= '<textarea class="input-xxlarge" name="'.$name.'">'.$value.'</textarea>';
|
||||||
else {
|
else {
|
||||||
if(strlen($value) > 40)
|
if(strlen($value) > 40)
|
||||||
$class = 'input-xxlarge';
|
$class = 'input-xxlarge';
|
||||||
|
@ -45,8 +62,13 @@ class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
|
||||||
$class = 'input-medium';
|
$class = 'input-medium';
|
||||||
else
|
else
|
||||||
$class = 'input-small';
|
$class = 'input-small';
|
||||||
echo '<input '.($type=='password' ? 'type="password"' : 'type="text"').'" class="'.$class.'" name="'.$name.'" value="'.$value.'" placeholder="'.$placeholder.'"/>';
|
$html .= '<input '.($type=='password' ? 'type="password"' : 'type="text"').'" class="'.$class.'" name="'.$name.'" value="'.$value.'" placeholder="'.$placeholder.'"/>';
|
||||||
}
|
}
|
||||||
|
return $html;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
protected function showTextField($name, $value, $type='', $placeholder='') { /* {{{ */
|
||||||
|
echo $this->getTextField($name, $value, $type, $placeholder);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,13 +96,37 @@ class SeedDMS_View_Settings extends SeedDMS_Bootstrap_Style {
|
||||||
*
|
*
|
||||||
* @param string $title title of the option
|
* @param string $title title of the option
|
||||||
* @param string $name name of html input field
|
* @param string $name name of html input field
|
||||||
|
* @param string $type can be 'password', 'array'
|
||||||
|
* @param string $placeholder placeholder for input field
|
||||||
*/
|
*/
|
||||||
protected function showConfigText($title, $name) { /* {{{ */
|
protected function showConfigText($title, $name, $type='', $placeholder='') { /* {{{ */
|
||||||
$settings = $this->params['settings'];
|
$settings = $this->params['settings'];
|
||||||
?>
|
?>
|
||||||
<tr title="<?= getMLText($title."_desc") ?>">
|
<tr title="<?= getMLText($title."_desc") ?>">
|
||||||
<td><?= getMLText($title) ?>:</td>
|
<td><?= getMLText($title) ?>:</td>
|
||||||
<td><?php $this->showTextField($name, $settings->{"_".$name}); ?></td>
|
<?php
|
||||||
|
if($type == 'array')
|
||||||
|
$value = $settings->arrayToString($settings->{"_".$name});
|
||||||
|
else
|
||||||
|
$value = $settings->{"_".$name};
|
||||||
|
?>
|
||||||
|
<td><?php $this->showTextField($name, $value, ($type=='password' ? 'password' : ''), $placeholder); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show a configuration option with arbitrary html content
|
||||||
|
*
|
||||||
|
* @param string $title title of the option
|
||||||
|
* @param string $rawdata html data
|
||||||
|
*/
|
||||||
|
protected function showConfigPlain($title, $title_desc, $rawdata) { /* {{{ */
|
||||||
|
$settings = $this->params['settings'];
|
||||||
|
?>
|
||||||
|
<tr title="<?= $title_desc ?>">
|
||||||
|
<td><?= $title ?>:</td>
|
||||||
|
<td><?= $rawdata ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
@ -186,16 +232,16 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<ul class="nav nav-tabs" id="settingstab">
|
<ul class="nav nav-tabs" id="settingstab">
|
||||||
<li class="<?php if(!$currenttab || $currenttab == 'site') echo 'active'; ?>"><a data-target="#site" data-toggle="tab"><?php printMLText('settings_Site'); ?></a></li>
|
<?php $this->showPaneHeader('site', getMLText('settings_Site'), (!$currenttab || $currenttab == 'site')); ?>
|
||||||
<li class="<?php if($currenttab == 'system') echo 'active'; ?>"><a data-target="#system" data-toggle="tab"><?php printMLText('settings_System'); ?></a></li>
|
<?php $this->showPaneHeader('system', getMLText('settings_System'), ($currenttab == 'system')); ?>
|
||||||
<li class="<?php if($currenttab == 'advanced') echo 'active'; ?>"><a data-target="#advanced" data-toggle="tab"><?php printMLText('settings_Advanced'); ?></a></li>
|
<?php $this->showPaneHeader('advanced', getMLText('settings_Advanced'), ($currenttab == 'advanced')); ?>
|
||||||
<li class="<?php if($currenttab == 'extensions') echo 'active'; ?>"><a data-target="#extensions" data-toggle="tab"><?php printMLText('settings_Extensions'); ?></a></li>
|
<?php $this->showPaneHeader('extensions', getMLText('settings_Extensions'), ($currenttab == 'extensions')); ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane <?php if(!$currenttab || $currenttab == 'site') echo 'active'; ?>" id="site">
|
<?php
|
||||||
<?php $this->contentContainerStart(); ?>
|
$this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site'));
|
||||||
<table class="table-condensed">
|
?>
|
||||||
<!--
|
<!--
|
||||||
-- SETTINGS - SITE - DISPLAY
|
-- SETTINGS - SITE - DISPLAY
|
||||||
-->
|
-->
|
||||||
|
@ -220,14 +266,8 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
-->
|
-->
|
||||||
<?php $this->showConfigHeadline('settings_Edition'); ?>
|
<?php $this->showConfigHeadline('settings_Edition'); ?>
|
||||||
<?php $this->showConfigCheckbox('settings_strictFormCheck', 'strictFormCheck'); ?>
|
<?php $this->showConfigCheckbox('settings_strictFormCheck', 'strictFormCheck'); ?>
|
||||||
<tr title="<?php printMLText("settings_viewOnlineFileTypes_desc");?>">
|
<?php $this->showConfigText('settings_viewOnlineFileTypes', 'viewOnlineFileTypes', 'array'); ?>
|
||||||
<td><?php printMLText("settings_viewOnlineFileTypes");?>:</td>
|
<?php $this->showConfigText('settings_editOnlineFileTypes', 'editOnlineFileTypes', 'array'); ?>
|
||||||
<td><?php $this->showTextField("viewOnlineFileTypes", $settings->getViewOnlineFileTypesToString()); ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr title="<?php printMLText("settings_editOnlineFileTypes_desc");?>">
|
|
||||||
<td><?php printMLText("settings_editOnlineFileTypes");?>:</td>
|
|
||||||
<td><?php $this->showTextField("editOnlineFileTypes", $settings->getEditOnlineFileTypesToString()); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php $this->showConfigCheckbox('settings_enableConverting', 'enableConverting'); ?>
|
<?php $this->showConfigCheckbox('settings_enableConverting', 'enableConverting'); ?>
|
||||||
<?php $this->showConfigCheckbox('settings_enableEmail', 'enableEmail'); ?>
|
<?php $this->showConfigCheckbox('settings_enableEmail', 'enableEmail'); ?>
|
||||||
<?php $this->showConfigCheckbox('settings_enableUsersView', 'enableUsersView'); ?>
|
<?php $this->showConfigCheckbox('settings_enableUsersView', 'enableUsersView'); ?>
|
||||||
|
@ -267,13 +307,11 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
<?php $this->showConfigCheckbox('settings_enableCalendar', 'enableCalendar'); ?>
|
<?php $this->showConfigCheckbox('settings_enableCalendar', 'enableCalendar'); ?>
|
||||||
<?php $this->showConfigOption('settings_calendarDefaultView', 'calendarDefaultView', array('w'=>'week_view', 'm'=>'month_view', 'y'=>'year_view'), false, true); ?>
|
<?php $this->showConfigOption('settings_calendarDefaultView', 'calendarDefaultView', array('w'=>'week_view', 'm'=>'month_view', 'y'=>'year_view'), false, true); ?>
|
||||||
<?php $this->showConfigOption('settings_firstDayOfWeek', 'firstDayOfWeek', array(' 0'=>'sunday', ' 1'=>'monday', ' 2'=>'tuesday', ' 3'=>'wednesday', ' 4'=>'thursday', ' 5'=>'friday', ' 6'=>'saturday'), false, true); ?>
|
<?php $this->showConfigOption('settings_firstDayOfWeek', 'firstDayOfWeek', array(' 0'=>'sunday', ' 1'=>'monday', ' 2'=>'tuesday', ' 3'=>'wednesday', ' 4'=>'thursday', ' 5'=>'friday', ' 6'=>'saturday'), false, true); ?>
|
||||||
</table>
|
<?php
|
||||||
<?php $this->contentContainerEnd(); ?>
|
$this->showEndPaneContent('site', $currenttab);
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane <?php if($currenttab == 'system') echo 'active'; ?>" id="system">
|
$this->showStartPaneContent('system', $currenttab == 'system');
|
||||||
<?php $this->contentContainerStart(); ?>
|
?>
|
||||||
<table class="table-condensed">
|
|
||||||
<!--
|
<!--
|
||||||
-- SETTINGS - SYSTEM - SERVER
|
-- SETTINGS - SYSTEM - SERVER
|
||||||
-->
|
-->
|
||||||
|
@ -324,32 +362,23 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
<?php $this->showConfigText('settings_dbHostname', 'dbHostname'); ?>
|
<?php $this->showConfigText('settings_dbHostname', 'dbHostname'); ?>
|
||||||
<?php $this->showConfigText('settings_dbDatabase', 'dbDatabase'); ?>
|
<?php $this->showConfigText('settings_dbDatabase', 'dbDatabase'); ?>
|
||||||
<?php $this->showConfigText('settings_dbUser', 'dbUser'); ?>
|
<?php $this->showConfigText('settings_dbUser', 'dbUser'); ?>
|
||||||
<tr title="<?php printMLText("settings_dbPass_desc");?>">
|
<?php $this->showConfigText('settings_dbPass', 'dbPass', 'password'); ?>
|
||||||
<td><?php printMLText("settings_dbPass");?>:</td>
|
|
||||||
<td><?php $this->showTextField("dbPass", $settings->_dbPass, 'password'); ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-- SETTINGS - SYSTEM - SMTP
|
-- SETTINGS - SYSTEM - SMTP
|
||||||
-->
|
-->
|
||||||
<tr ><td><b> <?php printMLText("settings_SMTP");?></b></td><td><a class="btn sendtestmail"><?php printMLText('send_test_mail'); ?></a></td> </tr>
|
<?php $this->showConfigHeadline('settings_SMTP'); ?>
|
||||||
<?php //$this->showConfigHeadline('settings_SMTP'); ?>
|
|
||||||
<?php $this->showConfigText('settings_smtpServer', 'smtpServer'); ?>
|
<?php $this->showConfigText('settings_smtpServer', 'smtpServer'); ?>
|
||||||
<?php $this->showConfigText('settings_smtpPort', 'smtpPort'); ?>
|
<?php $this->showConfigText('settings_smtpPort', 'smtpPort'); ?>
|
||||||
<?php $this->showConfigText('settings_smtpSendFrom', 'smtpSendFrom'); ?>
|
<?php $this->showConfigText('settings_smtpSendFrom', 'smtpSendFrom'); ?>
|
||||||
<?php $this->showConfigText('settings_smtpUser', 'smtpUser'); ?>
|
<?php $this->showConfigText('settings_smtpUser', 'smtpUser'); ?>
|
||||||
<tr title="<?php printMLText("settings_smtpPassword_desc");?>">
|
<?php $this->showConfigText('settings_smtpPassword', 'smtpPassword', 'password'); ?>
|
||||||
<td><?php printMLText("settings_smtpPassword");?>:</td>
|
<?php $this->showConfigPlain(htmlspecialchars(getMLText('settings_smtpSendTestMail')), htmlspecialchars(getMLText('settings_smtpSendTestMail_desc')), '<a class="btn sendtestmail">'.getMLText('send_test_mail').'</a>'); ?>
|
||||||
<td><input type="password" name="smtpPassword" value="<?php echo $settings->_smtpPassword ?>" /></td>
|
<?php
|
||||||
</tr>
|
$this->showEndPaneContent('system', $currenttab);
|
||||||
|
|
||||||
</table>
|
$this->showStartPaneContent('advanced', $currenttab == 'advanced');
|
||||||
<?php $this->contentContainerEnd(); ?>
|
?>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane <?php if($currenttab == 'advanced') echo 'active'; ?>" id="advanced">
|
|
||||||
<?php $this->contentContainerStart(); ?>
|
|
||||||
<table class="table-condensed">
|
|
||||||
<!--
|
<!--
|
||||||
-- SETTINGS - ADVANCED - DISPLAY
|
-- SETTINGS - ADVANCED - DISPLAY
|
||||||
-->
|
-->
|
||||||
|
@ -410,29 +439,15 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
$this->showConfigHeadline($target."_converters");
|
$this->showConfigHeadline($target."_converters");
|
||||||
if(!empty($settings->_converters[$target])) {
|
if(!empty($settings->_converters[$target])) {
|
||||||
foreach($settings->_converters[$target] as $mimetype=>$cmd) {
|
foreach($settings->_converters[$target] as $mimetype=>$cmd) {
|
||||||
?>
|
$this->showConfigPlain(htmlspecialchars($mimetype), htmlspecialchars($mimetype), $this->getTextField("converters[".$target."][".$mimetype."]", htmlspecialchars($cmd)));
|
||||||
<tr title="<?php echo $mimetype;?>">
|
|
||||||
<td><?php echo $mimetype;?>:</td>
|
|
||||||
<td><?php $this->showTextField("converters[".$target."][".$mimetype."]", htmlspecialchars($cmd)); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
$this->showConfigPlain($this->getTextField("converters[".$target."][newmimetype]", "", '', getMLText('converter_new_mimetype')), '', $this->getTextField("converters[".$target."][newcmd]", "", "", getMLText('converter_new_cmd')));
|
||||||
<tr title="">
|
|
||||||
<td><?php $this->showTextField("converters[".$target."][newmimetype]", "", '', getMLText('converter_new_mimetype')); ?>:</td>
|
|
||||||
<td><?php $this->showTextField("converters[".$target."][newcmd]", "", "", getMLText('converter_new_cmd')); ?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
?>
|
$this->showEndPaneContent('advanced', $currenttab);
|
||||||
</table>
|
|
||||||
<?php $this->contentContainerEnd(); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tab-pane <?php if($currenttab == 'extensions') echo 'active'; ?>" id="extensions">
|
$this->showStartPaneContent('extensions', $currenttab == 'extensions');
|
||||||
<?php $this->contentContainerStart(); ?>
|
?>
|
||||||
<table class="table-condensed">
|
|
||||||
<!--
|
<!--
|
||||||
-- SETTINGS - ADVANCED - DISPLAY
|
-- SETTINGS - ADVANCED - DISPLAY
|
||||||
-->
|
-->
|
||||||
|
@ -440,10 +455,7 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
foreach($GLOBALS['EXT_CONF'] as $extname=>$extconf) {
|
foreach($GLOBALS['EXT_CONF'] as $extname=>$extconf) {
|
||||||
$this->showRawConfigHeadline("<a name=\"".$extname."\"></a>".$extconf['title']);
|
$this->showRawConfigHeadline("<a name=\"".$extname."\"></a>".$extconf['title']);
|
||||||
foreach($extconf['config'] as $confkey=>$conf) {
|
foreach($extconf['config'] as $confkey=>$conf) {
|
||||||
?>
|
ob_start();
|
||||||
<tr title="<?php echo isset($conf['help']) ? $conf['help'] : '';?>">
|
|
||||||
<td><?php echo $conf['title'];?>:</td><td>
|
|
||||||
<?php
|
|
||||||
switch($conf['type']) {
|
switch($conf['type']) {
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
?>
|
?>
|
||||||
|
@ -530,21 +542,13 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->showTextField("extensions[".$extname."][".$confkey."]", isset($settings->_extensions[$extname][$confkey]) ? $settings->_extensions[$extname][$confkey] : '', '', '');
|
$this->showTextField("extensions[".$extname."][".$confkey."]", isset($settings->_extensions[$extname][$confkey]) ? $settings->_extensions[$extname][$confkey] : '', '', '');
|
||||||
/*
|
|
||||||
?>
|
|
||||||
<input type="text" name="<?php echo "extensions[".$extname."][".$confkey."]"; ?>" title="<?php echo isset($conf['help']) ? $conf['help'] : ''; ?>" value="<?php if(isset($settings->_extensions[$extname][$confkey])) echo $settings->_extensions[$extname][$confkey]; ?>" <?php echo isset($conf['size']) ? 'size="'.$conf['size'].'"' : ""; ?>" />
|
|
||||||
<?php
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
?>
|
$html = ob_get_clean();
|
||||||
</td></tr>
|
$this->showConfigPlain($conf['title'], isset($conf['help']) ? $conf['help'] : '', $html);
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$this->showEndPaneContent('extensions', $currenttab);
|
||||||
?>
|
?>
|
||||||
</table>
|
|
||||||
<?php $this->contentContainerEnd(); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if(is_writeable($settings->_configFilePath)) {
|
if(is_writeable($settings->_configFilePath)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user