Commit ff8276d4 authored by zaufi's avatar zaufi

Remains to code: premissions, menu entry, admin feature entry (?)

parent 3ea6104a
<?php
/** \file
* $Header: /cvsroot/tikiwiki/tiki/lib/integrator/integrator.php,v 1.3 2003-10-14 15:57:31 zaufi Exp $
* $Header: /cvsroot/tikiwiki/tiki/lib/integrator/integrator.php,v 1.4 2003-10-14 22:49:11 zaufi Exp $
*
* \brief Tiki integrator support class
*
......@@ -17,16 +17,17 @@ class TikiIntegrator extends TikiLib
/// Repository management
//\{
/// List all
function list_repositories()
function list_repositories($visible_only)
{
$query = "select * from tiki_integrator_repositories order by 'name'";
$cond = ($visible_only == true) ? "where visibility='y'" : '';
$query = "select * from tiki_integrator_repositories ".$cond." order by 'name'";
$result = $this->query($query);
$ret = Array();
while($res = $result->fetchRow(DB_FETCHMODE_ASSOC)) $ret[] = $res;
return $ret;
}
/// Add/Update
function add_replace_repository($repID, $name, $path, $start, $css, $descr)
function add_replace_repository($repID, $name, $path, $start, $css, $vis, $descr)
{
$name = addslashes($name);
$path = addslashes($path);
......@@ -34,12 +35,13 @@ class TikiIntegrator extends TikiLib
$css = addslashes($css);
$descr = addslashes($descr);
if (strlen($repID) == 0 || $repID == 0)
$query = "insert into tiki_integrator_repositories(name,path,start_page,css_file,description)
values('$name','$path','$start','$css','$descr')";
$query = "insert into tiki_integrator_repositories(name,path,start_page,css_file,visibility,description)
values('$name','$path','$start','$css','$vis','$descr')";
else
$query = "update tiki_integrator_repositories
set name='$name',path='$path',start_page='$start',
css_file='$css',description='$descr' where repID='$repID'";
css_file='$css',visibility='$vis',description='$descr'
where repID='$repID'";
$result = $this->query($query);
}
/// Get one entry by ID
......
/*
* $Header: /cvsroot/tikiwiki/tiki/styles/matrix/matrix-other.css,v 1.8 2003-08-09 22:24:59 zaufi Exp $
* $Header: /cvsroot/tikiwiki/tiki/styles/matrix/matrix-other.css,v 1.9 2003-10-14 22:49:11 zaufi Exp $
*
* Define styles for:
* Messages, RSS, Shoutbox
......@@ -132,3 +132,7 @@ div.shoutboxmodmsg.linkmodule:visited {
cursor: help;
text-decoration: none;
}
/* TikiIntegrator: By default copy rules dialog not shown */
div#rules-copy-panel {
display: none;
}
/*
* $Header: /cvsroot/tikiwiki/tiki/styles/notheme/notheme-other.css,v 1.6 2003-10-06 22:48:29 zaufi Exp $
* $Header: /cvsroot/tikiwiki/tiki/styles/notheme/notheme-other.css,v 1.7 2003-10-14 22:49:11 zaufi Exp $
*
* Define styles for:
* Messages, RSS, Shoutbox, Categories
......@@ -120,3 +120,7 @@ div.imgaldescr {
border: 3px ridge WindowFrame;
padding: 5px;
}
/* TikiIntegrator: By default copy rules dialog not shown */
div#rules-copy-panel {
display: none;
}
\ No newline at end of file
{* $Header: /cvsroot/tikiwiki/tiki/templates/tiki-admin_integrator.tpl,v 1.1 2003-10-13 17:17:22 zaufi Exp $ *}
{* $Header: /cvsroot/tikiwiki/tiki/templates/tiki-admin_integrator.tpl,v 1.2 2003-10-14 22:49:11 zaufi Exp $ *}
{if $repID > 0}
<h2>{tr}Edit this Repository:{/tr} {$name}</h2>
......@@ -29,6 +29,9 @@
</tr><tr>
<td class="formcolor">{tr}CSS file{/tr}</td>
<td class="formcolor"><input type="text" name="cssfile" value="{$cssfile|escape}" /></td>
</tr><tr>
<td class="formcolor">{tr}Visible{/tr}</td>
<td class="formcolor"><input type="checkbox" name="vis" {if $vis eq 'y'}checked="checked"{/if} /></td>
</tr><tr>
<td class="formcolor">{tr}Description{/tr}</td>
<td class="formcolor"><textarea name="description" rows="4">{$description|escape}</textarea></td>
......
{* $Header: /cvsroot/tikiwiki/tiki/templates/tiki-admin_integrator_rules.tpl,v 1.3 2003-10-14 22:13:14 zaufi Exp $ *}
{* $Header: /cvsroot/tikiwiki/tiki/templates/tiki-admin_integrator_rules.tpl,v 1.4 2003-10-14 22:49:11 zaufi Exp $ *}
<h2>{tr}Edit Rules for Repository:{/tr} {$name}</h2>
<div id="page-bar">
......@@ -26,18 +26,15 @@
{if count($reps) gt 0}
<div id="rules-copy-panel">
<form action="tiki-admin_integrator_rules.php?repID={$repID|escape}" method="post">
<table class="normal">
<tr>
<td class="formcolor" colspan="2">{tr}Copy options{/tr}</td>
</tr><tr>
<td class="formcolor">{tr}Source repository{/tr}</td>
<td class="formcolor"><select name="srcrep">{html_options options=$reps}</select></td>
</tr><tr>
<td class="formcolor">&nbsp;</td>
<td class="formcolor"><input type="submit" name="copy" value="{tr}Copy{/tr}" /></td>
</tr>
</table>
<table class="normal"><tr>
<td class="formcolor">{tr}Source repository{/tr}</td>
<td class="formcolor">
<select name="srcrep">{html_options options=$reps}</select> &nbsp; &nbsp;
<input type="submit" name="copy" value="{tr}Copy{/tr}" />
</td>
</tr> </table>
</form>
<br /><br />
</div>
{/if}
......@@ -61,7 +58,7 @@
</tr><tr>
<td class="formcolor">{tr}Case sensitive{/tr}</td>
<td class="formcolor">
<input type="checkbox" name="casesense" {if $type eq 'y'}checked="checked"{/if} /> &nbsp;&nbsp;
<input type="checkbox" name="casesense" {if $casesense eq 'y'}checked="checked"{/if} /> &nbsp;&nbsp;
{tr}Use case sensitive str_replace{/tr}
</td>
</tr><tr>
......
<?php
/**
* $Header: /cvsroot/tikiwiki/tiki/tiki-admin_integrator.php,v 1.1 2003-10-13 17:17:49 zaufi Exp $
* $Header: /cvsroot/tikiwiki/tiki/tiki-admin_integrator.php,v 1.2 2003-10-14 22:49:10 zaufi Exp $
*
* Admin interface for repositories management
*
......@@ -16,16 +16,17 @@ $path = isset($_REQUEST["path"]) ? $_REQUEST["path"] : '';
$start = isset($_REQUEST["start"]) ? $_REQUEST["start"] : '';
$cssfile = isset($_REQUEST["cssfile"]) ? $_REQUEST["cssfile"] : '';
$description = isset($_REQUEST["description"]) ? $_REQUEST["description"] : '';
$vis = isset($_REQUEST["vis"]) ? ($_REQUEST["vis"] == 'on' ? 'y' : 'n') : 'n';
// Check if 'submit' pressed ...
if (isset($_REQUEST["save"]))
{
// ... and all mandatory paramaters r OK
if ((strlen($name) > 0) && (strlen($path) > 0) && (strlen($start) > 0))
$integrator->add_replace_repository($repID, $name, $path, $start, $cssfile, $description);
if (strlen($name) > 0)
$integrator->add_replace_repository($repID, $name, $path, $start, $cssfile, $vis, $description);
else
{
$smarty->assign('msg',tra("Name, path and start page are mandatory fields"));
$smarty->assign('msg',tra("Repository name can't be an empty"));
$smarty->display("styles/$style_base/error.tpl");
die;
}
......@@ -44,6 +45,7 @@ if (isset($_REQUEST["action"]))
$smarty->assign('path', $rep["path"]);
$smarty->assign('start', $rep["start_page"]);
$smarty->assign('cssfile', $rep["css_file"]);
$smarty->assign('vis', $rep["visibility"]);
$smarty->assign('description', $rep["description"]);
}
break;
......@@ -57,10 +59,9 @@ if (isset($_REQUEST["action"]))
break;
}
}
//
// Fill list of repositories
$repositories = $integrator->list_repositories();
$repositories = $integrator->list_repositories(false);
$smarty->assign_by_ref('repositories', $repositories);
// Display the template
......
<?php
/**
* $Header: /cvsroot/tikiwiki/tiki/tiki-admin_integrator_rules.php,v 1.2 2003-10-14 15:58:09 zaufi Exp $
* $Header: /cvsroot/tikiwiki/tiki/tiki-admin_integrator_rules.php,v 1.3 2003-10-14 22:49:10 zaufi Exp $
*
* Admin interface for rules management
*
......@@ -131,7 +131,7 @@ $smarty->assign_by_ref('rules', $rules);
$smarty->assign('repID', $repID);
// Fill list of possible source repositories
$allreps = $integrator->list_repositories();
$allreps = $integrator->list_repositories(false);
$reps = array();
foreach($allreps as $rep) $reps[$rep["repID"]] = $rep["name"];
$smarty->assign_by_ref('reps', $reps);
......
<?php
/**
* $Header: /cvsroot/tikiwiki/tiki/tiki-list_integrator_repositories.php,v 1.1 2003-10-13 17:17:49 zaufi Exp $
* $Header: /cvsroot/tikiwiki/tiki/tiki-list_integrator_repositories.php,v 1.2 2003-10-14 22:49:10 zaufi Exp $
*
* Admin interface for repositories management
*
......@@ -10,7 +10,7 @@ require_once('tiki-setup.php');
require_once('lib/integrator/integrator.php');
// Fill list of repositories
$repositories = $integrator->list_repositories();
$repositories = $integrator->list_repositories(true);
$smarty->assign_by_ref('repositories', $repositories);
// Display the template
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment