Dotclear

Changeset 204


Ignore:
Timestamp:
06/18/08 17:50:49 (15 years ago)
Author:
olivier
Message:

Piwik plugin. Moved new site form to the good place and added a 404 Error handler.

Location:
plugins/piwik
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/piwik/_public.php

    r203 r204  
    4646               $action = $action == '' ? 'home' : str_replace('/',' : ',$action); 
    4747          } 
     48           
     49          # Check for 404 response 
     50          $h = headers_list(); 
     51          foreach ($h as $v) { 
     52               if (preg_match('/^status: 404/i',$v)) { 
     53                    $action = '404 Not Found/'.$action; 
     54               } 
     55          } 
     56           
    4857          echo dcPiwik::getScriptCode($piwik_service_uri,$piwik_site,$action); 
    4958     } 
  • plugins/piwik/index.php

    r203 r204  
    150150'</form>'; 
    151151 
    152 echo 
    153 '<h3>'.__('Create a new Piwik site for this blog').'</h3>'. 
    154 '<form action="'.$p_url.'" method="post">'. 
    155 '<p class="field"><label>'.__('Site name:').' '. 
    156 form::field('site_name',40,255,$site_name).'</label></p>'. 
    157 '<p class="field"><label>'.__('Site URL:').' '. 
    158 form::field('site_url',40,255,$site_url).'</label></p>'. 
    159 '<p><input type="submit" value="'.__('create site').'" />'. 
    160 $core->formNonce().'</p>'. 
    161 '</form>'; 
     152if ($piwik_uri) 
     153{ 
     154     echo 
     155     '<h3>'.__('Create a new Piwik site for this blog').'</h3>'. 
     156     '<form action="'.$p_url.'" method="post">'. 
     157     '<p class="field"><label>'.__('Site name:').' '. 
     158     form::field('site_name',40,255,$site_name).'</label></p>'. 
     159     '<p class="field"><label>'.__('Site URL:').' '. 
     160     form::field('site_url',40,255,$site_url).'</label></p>'. 
     161     '<p><input type="submit" value="'.__('create site').'" />'. 
     162     $core->formNonce().'</p>'. 
     163     '</form>'; 
     164} 
    162165 
    163166 
Note: See TracChangeset for help on using the changeset viewer.

Sites map