AMAPstudio

User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
admin [2012/10/30 16:21]
coligny
admin [2013/05/23 09:18] (current)
Line 1: Line 1:
 +====== AMAP software Wiki administration ======
  
 +This wiki is managed by **the AMAP developers and administrators**,​ this documentation is for them.
 +
 +
 +===== 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:
 +
 +<​code>​
 +<​form>​
 +action mail coligny@cirad.fr subscriber@email
 +thanks "The download link has been sent to your e-mail address, thanks for downloading our software."​
 +
 +fieldset "​Please register"​
 +textbox ​ "Your Name"
 +email "​E-mail address"​
 +textbox ​ "​Organism (optional)"​ !
 +textbox "​Motivation (optional)"​ !
 +static "This registration is only for internal statistics, the download link will be automatically sent to your e-mail address"​
 +
 +hidden "​Download link " "​=http://​amap-dev.cirad.fr/​projects/​yoursoftware/​files"​
 +
 +submit "​Submit Query"
 +</​form>​
 +</​code>​
 +
 +Explanation:​
 +  * The form will ask for the e-mail user's mail address (and other information)
 +  * This mail will be recognized by the download system if the email field label contains '​mail'​ (here: '​E-**mail** address'​)
 +  * The mail will be sent to you for statistics (here: **coligny@cirad.fr**)
 +  * and it will be sent to the user's mail (will replace **subscriber@email**) who will have the download link (here **'​http://​amap-dev.cirad.fr/​projects/​yoursoftware/​files'​**)
 +
 +<​box ​ 70% round blue| How to adapt this form to download my software ?>
 +You just have to **copy the form on your download page** and adapt **your own mail** (in '​action'​) and **your download link** (in '​hidden'​)
 +</​box>​
 +
 +
 +\\
 +\\
 +\\
 +
 +===== Technical pages for the Wiki administrators =====
 +
 +
 +==== 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
 +
 +<code php>
 +     /**
 +     * Build a nice email from the submitted data and send it
 +     */
 +    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;
 +    }
 +</​code>​
 +
 +
 +2. amapsoft/​lib/​plugins/​bureaucracy/​lang/​en/​lang.php:​ changed two labels
 +<​code>​
 +  $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";​
 +</​code>​
 +
 +
 +==== Edit the sidebar ====
 +
 +[[sidebar|Click here]]
 +
 +
 +==== Template for this wiki ====
 +
 +See the [[amapsoftTemplate|AMAPsoftware template pages]]