Dotclear

Changeset 2898


Ignore:
Timestamp:
01/19/11 14:22:26 (12 years ago)
Author:
Tomtom33
Message:

myLocation 0.1.4:

  • added mask configuration for location display, closes #637
Location:
plugins/myLocation/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • plugins/myLocation/trunk/_admin.php

    r2843 r2898  
    1717     $core->auth->check('admin',$core->blog->id)); 
    1818 
     19$core->addBehavior('adminPostHeaders',array('myLocationBehaviors','adminHeaders')); 
     20$core->addBehavior('adminPageHeaders',array('myLocationBehaviors','adminHeaders')); 
     21 
     22class myLocationBehaviors 
     23{ 
     24     public static function adminHeaders() 
     25     { 
     26          global $core; 
     27           
     28          return 
     29          dcPage::jsLoad('index.php?pf=myLocation/js/post.js'). 
     30          '<script type="text/javascript">'."\n". 
     31          '//<![CDATA['."\n". 
     32          'var post_location_checkbox = "'.__('Add my location').'";'."\n". 
     33          'var post_location_search = "'.__('Searching...').'";'."\n". 
     34          'var post_location_error_denied = "'.__('Permission denied by your browser').'";'."\n". 
     35          'var post_location_error_unavailable = "'.__('You location is currently unavailable. Please, try later').'";'."\n". 
     36          'var post_location_error_accuracy = "'.__('You location is currently unavailable for the choosen accuracy').'";'."\n". 
     37          'var post_location_longitude = "'.(isset($_POST['c_location_longitude']) ? $_POST['c_location_longitude'] : '').'";'."\n". 
     38          'var post_location_latitude = "'.(isset($_POST['c_location_latitude']) ? $_POST['c_location_latitude'] : '').'";'."\n". 
     39          'var post_location_address = "'.(isset($_POST['c_location_address']) ? $_POST['c_location_address'] : '').'";'."\n". 
     40          'var post_location_accuracy = "'.$core->blog->settings->myLocation->accuracy.'";'."\n". 
     41          '//]]>'."\n". 
     42          '</script>'."\n"; 
     43     } 
     44} 
     45 
    1946?> 
  • plugins/myLocation/trunk/_define.php

    r2844 r2898  
    1515          /* Description*/         "Display your current location", 
    1616          /* Author */             "Tomtom (http://blog.zenstyle.fr)", 
    17           /* Version */            '0.1.3', 
     17          /* Version */            '0.1.4', 
    1818          /* Permissions */        'usage,contentadmin' 
    1919); 
  • plugins/myLocation/trunk/_install.php

    r2843 r2898  
    2525$core->blog->settings->myLocation->put('accuracy','city','string','Geolocalisation accuracy',false,true); 
    2626$core->blog->settings->myLocation->put('css','','string','Custom CSS',false,true); 
     27$core->blog->settings->myLocation->put('mask','<a href="%1$s">%2$s</a>','string','Display mask',false,true); 
    2728 
    2829# --INSTALL AND UPDATE PROCEDURES-- 
  • plugins/myLocation/trunk/inc/class.rs.ext.comment.location.php

    r2843 r2898  
    3636          sprintf('http://maps.google.com/maps?q=%s,+%s+%s',$location['latitude'],$location['longitude'],''); 
    3737      
    38           return sprintf('<a href="%s">%s</a>',$url,$address); 
     38          return sprintf($rs->core->blog->settings->myLocation->mask,$url,$address); 
    3939     } 
    4040} 
  • plugins/myLocation/trunk/index.php

    r2843 r2898  
    2323          $core->blog->settings->myLocation->put('css',$_POST['css']); 
    2424          $core->blog->settings->myLocation->put('accuracy',$_POST['accuracy']); 
    25           http::redirect($p_url.'&upd'); 
     25          $core->blog->settings->myLocation->put('mask',$_POST['mask']); 
     26          http::redirect($p_url.'&upd=1'); 
    2627     } 
    2728     catch (Exception $e) { 
     
    6162'<form method="post" action="'.$p_url.'">'. 
    6263'<fieldset><legend>'.__('General options').'</legend>'. 
    63 '<p><label class="classic">'. 
     64'<p><label class="classic" for="enable">'. 
    6465     form::checkbox('enable','1',$core->blog->settings->myLocation->enable). 
    6566     __('Enable geolocation').'</label></p>'. 
    66 '<p><label class="field">'. 
     67'<p><label class="field" for="position">'. 
    6768     __('Position of location display').'&nbsp;'. 
    6869     form::combo('position',$combo_positions,$core->blog->settings->myLocation->position). 
    6970'</label></p>'. 
    70 '<p><label class="field">'. 
     71'<p><label class="field" for="css">'. 
    7172     __('Custom CSS'). 
    7273     form::field('css',100,255,$core->blog->settings->myLocation->css). 
    7374'</label></p>'. 
    7475'<p class="form-note">'.__('Leave blank to use the default plugin CSS').'</p>'. 
    75 '<p><label class="field">'. 
     76'<p><label class="field" for="accuracy">'. 
    7677     __('Geolocalisation accuracy').'&nbsp;'. 
    7778     form::combo('accuracy',$combo_accuracy,$core->blog->settings->myLocation->accuracy). 
    7879'</label></p>'. 
     80'<p><label class="field" for="mask">'. 
     81     __('Display mask').'&nbsp;'. 
     82     form::field('mask',100,255,html::escapeHTML($core->blog->settings->myLocation->mask)). 
     83'</label></p>'. 
     84'<p class="form-note">'.__('%1$s = Google Maps URL, %2$s = location text').'</p>'. 
    7985'</fieldset>'. 
    8086'<p>'.$core->formNonce().'<input type="submit" name="save" value="'.__('Save').'" /></p>'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map