Dotclear

Changeset 2507


Ignore:
Timestamp:
07/24/10 21:46:34 (13 years ago)
Author:
Osku
Message:

construction 1.1

  • allow extra URL types
Location:
plugins/construction
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • plugins/construction/_define.php

    r2472 r2507  
    1717     /* Description*/    "Put your blog in construction", 
    1818     /* Author */        "Osku and contributors", 
    19      /* Version */       '1.0.2', 
     19     /* Version */       '1.1', 
    2020     /* Permissions */   'admin', 
    2121     /* Priority */      2000 
  • plugins/construction/_install.php

    r2440 r2507  
    5656); 
    5757 
     58$s->put('construction_extra_urls', 
     59     serialize(array()), 
     60     'string', 
     61     'Construction blog message', 
     62     true, 
     63     true 
     64); 
     65 
    5866$core->setVersion('construction',$new_version); 
    5967return true; 
  • plugins/construction/_public.php

    r2440 r2507  
    2727          $core->tpl->setPath($core->tpl->getPath(), dirname(__FILE__).'/default-templates'); 
    2828          $all_allowed_ip = unserialize($core->blog->settings->construction->construction_allowed_ip); 
     29          $extra_urls = unserialize($core->blog->settings->construction->construction_extra_urls); 
    2930          if (!in_array(http::realIP(),$all_allowed_ip)) 
    3031          { 
     
    3435               foreach ($core->url->getTypes() as $k=>$v) 
    3536               { 
    36                     if ($k != 'contactme') 
     37                    if (($k != 'contactme') && !in_array($k,$extra_urls)) 
    3738                    { 
    3839                         $core->url->register($k,$v['url'],$v['representation'],array('urlConstruction','p503')); 
     
    5354     public static function default503($args,$type,$e) 
    5455     { 
    55           if ($e->getCode() == 503) { 
    56                $_ctx =& $GLOBALS['_ctx']; 
    57                $core =& $GLOBALS['core']; 
    58            
    59                header('Content-Type: text/html; charset=UTF-8'); 
    60                http::head(503,'Service Unavailable'); 
    61                $core->url->type = '503'; 
    62                $_ctx->current_tpl = '503.html'; 
    63                $_ctx->content_type = 'text/html'; 
    64            
    65                echo $core->tpl->getData($_ctx->current_tpl); 
    66            
    67                # --BEHAVIOR-- publicAfterDocument 
    68                $core->callBehavior('publicAfterDocument',$core); 
    69                exit; 
    70           } 
     56          //if ($e->getCode() == 503) { 
     57          $_ctx =& $GLOBALS['_ctx']; 
     58          $core =& $GLOBALS['core']; 
     59      
     60          header('Content-Type: text/html; charset=UTF-8'); 
     61          http::head(503,'Service Unavailable'); 
     62          $core->url->type = '503'; 
     63          $_ctx->current_tpl = '503.html'; 
     64          $_ctx->content_type = 'text/html'; 
     65      
     66          echo $core->tpl->getData($_ctx->current_tpl); 
     67      
     68          # --BEHAVIOR-- publicAfterDocument 
     69          $core->callBehavior('publicAfterDocument',$core); 
     70          exit; 
     71          //} 
    7172     } 
    7273      
  • plugins/construction/index.php

    r2472 r2507  
    3131               $allowed_ip[] = trim($ip); 
    3232          } 
     33          $urls = explode(",",$_POST['construction_extra_urls']); 
     34          foreach ($urls as $url) { 
     35               $extra_urls[] = trim($url); 
     36          } 
    3337          $s->put('construction_allowed_ip',serialize($allowed_ip),'string','Construction blog allowed ip'); 
    3438          $s->put('construction_title',$_POST['construction_title'],'string','Construction blog title');       
    3539          $s->put('construction_message',$_POST['construction_message'],'string','Construction blog message'); 
     40          $s->put('construction_extra_urls',serialize($extra_urls),'string','Construction extra allowed URLs'); 
    3641 
    3742          $core->blog->triggerBlog(); 
     
    7782'</p> 
    7883<p class="form-note">'.sprintf(__('Your IP is <strong>%s</strong> - the allowed IP can view the blog normally.'),$myip).'</p> 
     84<p class="area"><label for="construction_extra_urls">'.__('Extra allowed URL types:').'</label>'. 
     85form::field('construction_extra_urls',20,255,html::escapeHTML(implode(',',unserialize($s->construction_extra_urls))),'maximal'). 
     86'</p> 
    7987</fieldset> 
    8088<fieldset> 
  • plugins/construction/locales/fr/main.po

    r2442 r2507  
    1 # Language: Français 
    2 # Module: construction - 1.0 
    3 # Date: 2010-07-04 17:01:14 
    4 # Translated with translater 1.4.1 
    51 
    62msgid "" 
    73msgstr "" 
    84"Content-Type: text/plain; charset=UTF-8\n" 
    9 "Project-Id-Version: construction 1.0\n" 
     5"Project-Id-Version: construction 1.1\n" 
    106"POT-Creation-Date: \n" 
    11 "PO-Revision-Date: 2010-07-04T17:01:14+00:00\n" 
    12 "Last-Translator: osku\n" 
     7"PO-Revision-Date: 2010-07-24T19:35:41+00:00\n" 
     8"Last-Translator: Osku\n" 
    139"Language-Team: \n" 
    1410"MIME-Version: 1.0\n" 
    1511"Content-Transfer-Encoding: 8bit\n" 
    1612 
    17 #: _admin.php:23 
    18 #: index.php:55 
    1913msgid "Construction" 
    2014msgstr "Construction" 
    2115 
    22 #: _install.php:43 
    2316msgid "Work in progress" 
    2417msgstr "Travaux en cours" 
    2518 
    26 #: _install.php:51 
    2719msgid "<p>The blog is currently under construction.</p>" 
    2820msgstr "<p>Le blog est actuellement en construction.</p>" 
    2921 
    30 #: index.php:63 
    3122msgid "Configuration successfully updated." 
    3223msgstr "Configuration mise à jour avec succès." 
    3324 
    34 #: index.php:65 
    3525msgid "construction" 
    3626msgstr "construction" 
    3727 
    38 #: index.php:70 
    3928msgid "Configuration" 
    4029msgstr "Configuration" 
    4130 
    42 #: index.php:73 
    4331msgid "Plugin activation" 
    4432msgstr "Activation de l'extension" 
    4533 
    46 #: index.php:75 
    4734msgid "Allowed IP:" 
    48 msgstr "IP autorisées" 
     35msgstr "IP autorisées :" 
    4936 
    50 #: index.php:78 
    5137msgid "Your IP is <strong>%s</strong> - the allowed IP can view the blog normally." 
    5238msgstr "Votre IP est <strong>%s</strong> - les IP autorisées peuvent visualiser le blog normalement." 
    5339 
    54 #: index.php:81 
     40msgid "Extra allowed URL types:" 
     41msgstr "Autres types d'URL autorisées :" 
     42 
    5543msgid "Presentation" 
    56 msgstr "Présensation" 
     44msgstr "Présentation" 
    5745 
    58 #: index.php:82 
    5946msgid "Title:" 
    6047msgstr "Titre :" 
    6148 
    62 #: index.php:85 
    6349msgid "Informations:" 
    64 msgstr "Informations :" 
     50msgstr "Information :" 
    6551 
    66 #: index.php:91 
    6752msgid "save" 
    6853msgstr "enregistrer" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map