====== AMAP software Wiki administration ======
This wiki is managed by **the AMAP developers and administrators**, this documentation is for them.
fc-16.12.2021 See the wiki pages on amap-dev about the migration of Capsis and AMAPstudio Dokuwikis to newer versions in Dec 2021 : https://amap-dev.cirad.fr/projects/commons/wiki/CAPSIS_DokuWiki#section-4
===== Authors FAQ =====
==== How do I add my pages in the lateral menu ? ====
[[pageeditor|Go to this page to create your software pages]] and make them appear correctly in the lateral menu.
==== How do I -hide- some pages in the lateral menu ? ====
Sometimes you add a wiki page from a page in the lateral menu and you do not want this new page to create a new entry in the menu.
-> At page creation time, just make sure its name starts with "**.:private:**"
E.g. %% [[.:private:OPF format]] %%
The lateral menu was configured to ignore the pages which name contains this char sequence.
==== How can I track the downloads for my software ? ====
Use this kind of text to get a download form:
EDIT: updated on 16.12.2021 by fc
Explanation:
* This form works with the Bureaucracy plugin
* The form will ask for the e-mail user's mail address (and other information)
* The mail will be sent to you for statistics (here: **coligny@cirad.fr**)
* and it will be sent to the user's mail who will have the download link (here **'https://amap-dev.cirad.fr/projects/capsis/files'**)
You just have to **copy the form on your download page** and adapt **your own mail** (in 'action') and **your download link** (in 'hidden')
===== Technical pages for the Wiki administrators =====
/* fc-16.12.2021 removed, new way: mail section and hidden messages
==== Configuring the download system ====
Used the dokuwiki bureaucracy plugin with little changes in the php files:
1. amapsoft/lib/plugins/bureaucracy/actions/mail.php: added a paragraph, removed a line
function run($data, $thanks, $argv) {
global $ID;
// get recipient address(es)
$to = join(',',$argv);
$sub = sprintf($this->getLang('mailsubject'),$ID);
$txt = sprintf($this->getLang('mailintro')."\n\n\n", dformat());
foreach($data as $opt){
$value = $opt->getParam('value');
$label = $opt->getParam('label');
A // Add subscriber email to $to
A if(strripos($to, "subscriber@email") !== false && strripos($label, "mail") !== false) {
A $trans = array("subscriber@email" => $value);
A $to = strtr($to, $trans);
A }
switch($opt->getFieldType()){
case 'fieldset':
D // $txt .= "\n====== ".hsc($label)." ======\n\n";
break;
default:
if($value === null || $label === null) break;
$txt .= $label."\n";
$txt .= "\t\t$value\n";
}
}
global $conf;
if(!mail_send($to, $sub, $txt, $conf['mailfrom'])) {
throw new Exception($this->getLang('e_mail'));
}
return $thanks;
}
2. amapsoft/lib/plugins/bureaucracy/lang/en/lang.php: changed two labels
$lang['mailsubject'] = 'AMAPsoftware download (%s)';
$lang['mailintro'] = "Hello,\nyou may download the package you requested on AMAPsoftware with the link below.\nRegards,\nThe AMAP developers";
... removed */
==== Edit the sidebar ====
[[sidebar|Click here]]
==== Template for this wiki ====
See the [[amapsoftTemplate|AMAPsoftware template pages]]