steffen: server/kolab-horde-fbview/kolab-horde-fbview/fbview/templates/prefs app.inc, NONE, 1.1 begin.inc, NONE, 1.1 categorymanagement.inc, NONE, 1.1 checkbox.inc, NONE, 1.1 deleteidentity.inc, NONE, 1.1 end.inc, NONE, 1.1 enum.inc, NONE, 1.1 identityselect.inc, NONE, 1.1 link.inc, NONE, 1.1 multienum.inc, NONE, 1.1 number.inc, NONE, 1.1 overview.inc, NONE, 1.1 password.inc, NONE, 1.1 select.inc, NONE, 1.1 text.inc, NONE, 1.1 textarea.inc, NONE, 1.1

cvs at intevation.de cvs at intevation.de
Mon Oct 31 12:43:37 CET 2005


Author: steffen

Update of /kolabrepository/server/kolab-horde-fbview/kolab-horde-fbview/fbview/templates/prefs
In directory doto:/tmp/cvs-serv18388/kolab-horde-fbview/kolab-horde-fbview/fbview/templates/prefs

Added Files:
	app.inc begin.inc categorymanagement.inc checkbox.inc 
	deleteidentity.inc end.inc enum.inc identityselect.inc 
	link.inc multienum.inc number.inc overview.inc password.inc 
	select.inc text.inc textarea.inc 
Log Message:
Fbview in separate package

--- NEW FILE: app.inc ---
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
 <td class="header">
  <?php printf(_("Options for %s"), $registry->getParam('name')) ?>
 </td>
 <td class="header" align="right" nowrap="nowrap">
  <form method="get" name="appswitch">
   <?php echo Util::formInput() ?>
   <span class="smallheader"><?php echo _("Edit options for:") ?></span>
   <select name="app" onchange="document.appswitch.submit();">
     <option value=""></option>
    <?php foreach ($apps as $key => $val): ?>
     <option value="<?php echo htmlspecialchars($key) ?>"><?php echo htmlspecialchars($val) ?></option>
    <?php endforeach; ?>
   </select>
   <input class="button" type="submit" onclick="if (document.appswitch.app.selectedIndex == 0) return false;" value="<?php echo _("Go") ?>" />
  </form>
 </td>
</tr>
</table>
<br />

--- NEW FILE: begin.inc ---
<form method="post" name="prefs" action="<?php echo Horde::selfURL() ?>">
<?php Util::pformInput() ?>
<input type="hidden" name="actionID" value="update_prefs" />
<input type="hidden" name="group" value="<?php echo $group ?>" />
<input type="hidden" name="app" value="<?php echo $app ?>" />

<table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
<tr><td class="header" align="left"><b><?php echo $prefGroups[$group]['label'] ?></b></td>
<?php Prefs_UI::generateNavigationCell($group) ?>
</tr>
</table>
<table border="0" align="center" width="100%" cellspacing="0" cellpadding="3">
<tr><td class="item"><table border="0"><tr valign="top"><td class="item">

--- NEW FILE: categorymanagement.inc ---
<script language="JavaScript" type="text/javascript">
<!--
function remove(category)
{
    document.prefs.cAction.value = 'remove';
    document.prefs.category.value = category;
    document.prefs.submit();
}

function add()
{
    var category = window.prompt('<?php echo addslashes(_("Please enter a name for the new category:")) ?>', '');
    if (category != null && category != '') {
        document.prefs.cAction.value = 'add';
        document.prefs.category.value = category;
        document.prefs.submit();
    }
}
//-->
</script>
<input name="cAction" value="" type="hidden" />
<input name="category" value="" type="hidden" />
<table border="0">

<tr>
  <td colspan="2">
    <input type="button" class="button" value="<?php echo _("New Category") ?>" onclick="add();" />
  </td>
</tr>

<?php

require_once 'Horde/Prefs/CategoryManager.php';
$cManager = &new Prefs_CategoryManager();
$categories = $cManager->get();
$colors = $cManager->colors();
$url = Horde::url($registry->getParam('webroot', 'horde') . '/services/images/colorpicker.php');
$url = Util::addParameter($url, 'form', 'prefs');

// Default Color
$color = isset($colors['_default_']) ? $colors['_default_'] : '#FFFFFF';
$c_url = Util::addParameter($url, 'target', 'color_' . base64_encode('_default_'));
?>
<tr>
  <td style="background-color:<?php echo $color ?>"><b><?php echo _("Default Color") ?></b></td>
  <td>
    <?php if (!$prefs->isLocked('category_colors')): ?>
      <input class="fixed" size="7" style="background-color:<?php echo $color ?>" name="color_<?php echo base64_encode('_default_') ?>" value="<?php echo $color ?>" />
      <a href="<?php echo $c_url ?>" onclick="window.open('<?php echo $c_url ?>', 'colorpicker', 'toolbar=no,location=no,status=no,scrollbars=no,resizable=no,width=120,height=250,left=100,top=100'); return false;" onmouseout="window.status='';" onmouseover="window.status='<?php echo _('Color Picker') ?>'; return true;" class="widget" target="colorpicker">
      <?php echo Horde::img('colorpicker.gif', _('Color Picker'), 'height="16"', $registry->getParam('graphics', 'horde')) ?></a>
    <?php endif; ?>
  </td>
</tr>

<?php
// Unfiled Color
$color = isset($colors['_unfiled_']) ? $colors['_unfiled_'] : '#FFFFFF';
$c_url = Util::addParameter($url, 'target', 'color_' . base64_encode('_unfiled_'));
?>
<tr>
  <td style="background-color:<?php echo $color ?>"><b><?php echo _("Unfiled") ?></b></td>
  <td>
    <?php if (!$prefs->isLocked('category_colors')): ?>
      <input class="fixed" size="7" style="background-color:<?php echo $color ?>" name="color_<?php echo base64_encode('_unfiled_') ?>" value="<?php echo $color ?>" />
      <a href="<?php echo $c_url ?>" onclick="window.open('<?php echo $c_url ?>', 'colorpicker', 'toolbar=no,location=no,status=no,scrollbars=no,resizable=no,width=120,height=250,left=100,top=100'); return false;" onmouseout="window.status='';" onmouseover="window.status='<?php echo _('Color Picker') ?>'; return true;" class="widget" target="colorpicker">
      <?php echo Horde::img('colorpicker.gif', _('Color Picker'), 'height="16"', $registry->getParam('graphics', 'horde')) ?></a>
    <?php endif; ?>
  </td>
</tr>

<?php
foreach ($categories as $name):
    $color = isset($colors[$name]) ? $colors[$name] : '#FFFFFF';
    $c_url = Util::addParameter($url, 'target', 'color_' . base64_encode($name));
?>
<tr>
  <td style="background-color:<?php echo $color ?>"><b><?php echo ($name == '_default_' ? _("Default Color") : $name) ?></b></td>
  <td>
    <?php if (!$prefs->isLocked('category_colors')): ?>
      <input class="fixed" size="7" style="background-color:<?php echo $color ?>" name="color_<?php echo base64_encode($name) ?>" value="<?php echo $color ?>" />
      <a href="<?php echo $c_url ?>" onclick="window.open('<?php echo $c_url ?>', 'colorpicker', 'toolbar=no,location=no,status=no,scrollbars=no,resizable=no,width=120,height=250,left=100,top=100'); return false;" onmouseout="window.status='';" onmouseover="window.status='<?php echo _('Color Picker') ?>'; return true;" class="widget" target="colorpicker">
      <?php echo Horde::img('colorpicker.gif', _('Color Picker'), 'height="16"', $registry->getParam('graphics', 'horde')) ?></a>
    <?php endif; ?>
    <a href="" onclick="remove('<?php echo htmlspecialchars($name) ?>'); return false;"><?php echo Horde::img('delete.gif') ?></a>
  </td>
</tr>
<?php endforeach; ?>

</table>

--- NEW FILE: checkbox.inc ---
<input type="checkbox" id="<?php echo $pref ?>" name="<?php echo $pref ?>"<?php echo $prefs->getValue($pref) ? ' checked="checked"' : '' ?> />
<?php echo Horde::label($pref, $_prefs[$pref]['desc']) ?> <?php echo $helplink ?>
<br />

--- NEW FILE: deleteidentity.inc ---
<script language="JavaScript" type="text/javascript">
<!--
function deleteIdentity()
{
    var index = document.prefs.identity.selectedIndex;
    var id = document.prefs.identity.options[index].value;
    if (id >= 0) {
        document.location.href = "<?php echo str_replace('&', '&', Util::addParameter(Horde::selfUrl(true), array('actionID' => 'delete_identity', 'id' => ''))) ?>" + id;
    }
}
//-->
</script>
<br />
<input type="button" onclick="deleteIdentity()" class="button" value="<?php echo _("Delete selected identity") ?>" /><br /><br />

--- NEW FILE: end.inc ---
</td></tr></table></td></tr></table>

<br />
<table border="0" align="center" width="100%" cellspacing="0" cellpadding="0"><tr><td nowrap="nowrap">
<input type="submit" class="button" value="<?php echo _("Save Options") ?>" /> 
<input type="reset" class="button" value="<?php echo _("Undo Changes") ?>" /> 
<input type="button" class="button" value="<?php echo _("Return to Options") ?>" onclick="document.prefs.actionID.value=0; document.prefs.group.value=''; document.prefs.submit();" />
</td></tr></table>
</form>

--- NEW FILE: enum.inc ---
<?php echo Horde::label($pref, $_prefs[$pref]['desc']) ?> <?php echo $helplink ?><br />
<select id="<?php echo $pref ?>" name="<?php echo $pref ?>">
<?php foreach ($_prefs[$pref]['enum'] as $key => $val): ?>
<option<?php echo $prefs->getValue($pref) == $key ? ' selected="selected"' : '' ?> value="<?php echo $key ?>"><?php echo $val ?></option>
<?php endforeach ?>
</select>
<br />

--- NEW FILE: identityselect.inc ---
<script language="JavaScript" type="text/javascript">
<!--

var identities = new Array();
<?php
global $identity;
$identities = $identity->getAll('id');
$members = $prefGroups['identities']['members'];
for ($i = 0; $i < count($identities); $i++):
?>
identities[<?php echo $i ?>] = new Array();
<?php
$k = 0;
foreach ($members as $member):
    if ($member == 'default_identity' || 
        $_prefs[$member]['type'] == 'special' ||
        $_prefs[$member]['type'] == 'link') {
        continue;
    }
?>
identities[<?php echo $i ?>][<?php echo $k++ ?>] = new Array("<?php echo $member ?>", "<?php echo $_prefs[$member]['type'] ?>", <?php
$val = $identity->getValue($member, $i);
switch ($_prefs[$member]['type']) {
case 'checkbox':
    echo $val ? 'true' : 'false';
    break;
case 'number':
    echo (int)$val;
    break;
case 'textarea':
    if (is_array($val)) {
        $val = implode("\n", $val);
    }
    echo '"' . str_replace(array("\r", "\n"), array('', '\n'), addslashes($val)) . '"';        
    break;
default:
    echo '"' . addslashes($val) . '"';
    break;
}
?>);
<?php endforeach; endfor; ?>

function newChoice()
{
    var field, val;
    var index = document.prefs.identity.selectedIndex;
    var id = document.prefs.identity.options[index].value;
    if (id < 0) {
        document.prefs.reset();
        document.prefs.identity.selectedIndex = index;
        return;
    }
    for (var i = 0; i < identities[id].length; i++) {
        field = eval("document.prefs." + identities[id][i][0]);
        val = identities[id][i][2];
        switch (identities[id][i][1]) {
            case "enum":
                for (var j = 0; j < field.options.length; j++) {
                    if (field.options[j].value == val) {
                        field.selectedIndex = j;
                        break;
                    }
                }
                break;
            case "checkbox":
                field.checked = val;
                break;
            case "implicit":
                eval("newChoice_" + identities[id][i][0] + "(val)");
                break;
            default:
                field.value = val;
                break;
        }
    }
}

//-->
</script>
<br />
<?php echo Horde::label('identity', _("Select the identity you want to change:")) ?><br />
<select name="identity" id="identity" onchange="javascript:newChoice()">
  <option value="-2" selected="selected"
><?php echo _("None") ?></option>
  <option value="-1"><?php echo _("Create a new one") ?></option>
<?php for ($i = 0; $i < count($identities); $i++): ?>
  <option value="<?php echo $i ?>"><?php echo $identities[$i] ?></option>
<?php endfor; ?>
</select><br />

--- NEW FILE: link.inc ---
<p><a href="<?php echo (isset($_prefs[$pref]['url'])) ? Horde::applicationUrl($_prefs[$pref]['url']) : $_prefs[$pref]['xurl'] ?>"><?php if (isset($_prefs[$pref]['img'])) echo Horde::img($_prefs[$pref]['img'], $_prefs[$pref]['desc'], 'hspace="3"') ?><b><?php echo $_prefs[$pref]['desc'] ?></b></a> <?php echo $helplink ?></p>

--- NEW FILE: multienum.inc ---
<?php echo Horde::label($pref, $_prefs[$pref]['desc']) ?> <?php echo $helplink ?><br />
<select id="<?php echo $pref ?>" multiple="multiple" size="<?php echo min(4, count($_prefs[$pref]['enum'])) ?>" name="<?php echo $pref ?>[]">
<?php $selected = @unserialize($prefs->getValue($pref)); foreach ($_prefs[$pref]['enum'] as $key => $val): ?>
<option<?php echo in_array($key, $selected) ? ' selected="selected" ' : '' ?> value="<?php echo $key ?>"><?php echo $val ?></option>
<?php endforeach ?>
</select>
<br />

--- NEW FILE: number.inc ---
<input type="text" id="<?php echo $pref ?>" name="<?php echo $pref ?>" size="3" maxlength="3" value="<?php echo $prefs->getValue($pref) ?>" />
<?php echo Horde::label($pref, $_prefs[$pref]['desc']) ?> <?php echo $helplink ?><br />

--- NEW FILE: overview.inc ---
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>

<?php $count = 0; foreach ($columns as $key => $col): ?>
    <td width="<?php echo $span ?>%">
        <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr><td class="header" align="center"><b><?php echo $key ?></b></td></tr>
        </table>
    </td>

<?php $count++; if ($count < count($columns)): ?>
    <td width="1%" rowspan="5"> </td>
<?php endif; ?>
<?php endforeach; ?>

</tr>
<tr valign="top">

<?php foreach ($columns as $key => $column): ?>
    <td width="<?php echo $span ?>%">
        <table cellpadding="2" cellspacing="0" border="0" width="100%">

<?php foreach ($column as $group => $gvals): ?>
<?php if (Prefs_UI::groupIsEditable($group)): ?>
<?php if (!empty($gvals['url'])): ?>
            <tr><td class="control"><b><?php echo Horde::widget(Horde::applicationUrl($gvals['url'], $app), $gvals['label'], 'widget', '', '', $gvals['label']) ?></b></td></tr>
<?php else: ?>
            <tr><td class="control"><b><?php echo Horde::widget(Util::addParameter(Horde::selfURL(), array('group' => $group, 'app' => $GLOBALS['app'])), $gvals['label'], 'widget', '', '', $gvals['label']) ?></b></td></tr>
<?php endif; ?>
            <tr><td class="item"><?php echo $gvals['desc'] ?></td></tr>
            <tr><td style="font-size:3px;"> </td></tr>
<?php endif; ?>
<?php endforeach; ?>

        </table>
    </td>
<?php endforeach; ?>

</tr>
</table>
<br />

--- NEW FILE: password.inc ---
<?php echo Horde::label($pref, $_prefs[$pref]['desc']) ?> <?php echo $helplink ?><br />
<input type='password' id="<?php echo $pref ?>" name="<?php echo $pref ?>" size="30" maxlength="60" class="fixed" value="<?php echo htmlspecialchars($prefs->getValue($pref)) ?>" /><br />

--- NEW FILE: select.inc ---
<?php echo Horde::label($pref, $_prefs[$pref]['desc']) ?> <?php echo $helplink ?><br />
<select id="<?php echo $pref ?>" name="<?php echo $pref ?>">
    <option value=""<?php if (!$prefs->getValue($pref)) echo ' selected="selected"'; ?>><?php echo _("Use Default Value") ?></option>
<?php $select_var = $pref . '_options'; foreach ($GLOBALS[$select_var] as $select_key => $select_val): ?>
    <option value="<?php echo htmlspecialchars($select_key) ?>"<?php if ($select_key == $prefs->getValue($pref)) echo ' selected="selected"' ?>><?php echo $select_val ?></option>
<?php endforeach; ?>
</select>
<br />

--- NEW FILE: text.inc ---
<?php echo Horde::label($pref, $_prefs[$pref]['desc']) ?> <?php echo $helplink ?><br />
<input id="<?php echo $pref ?>" name="<?php echo $pref ?>" size="30" maxlength="60" class="fixed" value="<?php echo htmlspecialchars($prefs->getValue($pref)) ?>" /><br />

--- NEW FILE: textarea.inc ---
<?php echo Horde::label($pref, $_prefs[$pref]['desc']) ?> <?php echo $helplink ?><br />
<div class="fixed">
<textarea wrap="hard" id="<?php echo $pref ?>" name="<?php echo $pref ?>" rows="6" cols="80" class="fixed"><?php echo htmlspecialchars($prefs->getValue($pref)) ?></textarea><br />
</div>





More information about the commits mailing list