Plugin Directory

Changeset 1121876


Ignore:
Timestamp:
03/27/2015 01:35:16 AM (11 years ago)
Author:
hyppoCom
Message:

Added options

Location:
chatup/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • chatup/trunk/chatup.php

    r1121158 r1121876  
    115115    public function wpFooterScript($arg) {
    116116    $cid=$this->__fillOption('campaign');
     117    $hide_na=$this->__fillOption('hide_na');
     118    $online_img=$this->__fillOption('online_img');
     119    $offline_img=$this->__fillOption('offline_img');
    117120    $s="<script>\n".
    118121       "var _chatup=_chatup||[];\n".
     
    121124       "    if(x) {\n".
    122125       "        _chatup.push('setCampaign','$cid');\n".
     126       ($hide_na?"      _chatup.push('setHideUnavailable',true);":"").
     127       ($online_img?"   _chatup.push('setOnlineImage','$online_img');":"").
     128       ((!$hide_na && $offline_img)?"   _chatup.push('setOfflineImage','$offline_img');":"").
    123129       "        _chatup.push('showButton','chatup_but');\n".
    124130       "        (function(c,h,a,t) { t=h.createElement(c); t.async=1; t.src='//chatup.it/chatup.js'; a=h.getElementsByTagName(c)[0]; a.parentNode.insertBefore(t,a) })('script',document);\n".
     
    154160        $this->__options = array(
    155161            'campaign'      => 0,   // Campaign ID
     162            'hide_na'       => 0,   // Hide if no operators available
     163            'online_img'    => "",  // Image URL
     164            'offline_img'   => "",  // Image URL
    156165        );
    157166    }
     
    165174        // register_setting('chatup','chatup_campaign',array($this,'validateCampaign'));
    166175        register_setting('chatup','chatup_campaign');
     176        register_setting('chatup','chatup_hide_na');
     177        register_setting('chatup','chatup_online_img');
     178        register_setting('chatup','chatup_offline_img');
    167179    }
    168180
     
    174186    private function __deleteOptions() {
    175187        delete_option('chatup_campaign');
     188        delete_option('chatup_hide_na');
     189        delete_option('chatup_online_img');
     190        delete_option('chatup_offline_img');
    176191    }
    177192
     
    183198    private function __fillOptions() {
    184199        $this->__fillOption('campaign');
     200        $this->__fillOption('hide_na');
     201        $this->__fillOption('online_img');
     202        $this->__fillOption('offline_img');
    185203    }
    186204
  • chatup/trunk/languages/chatup-it_IT.po

    r1121158 r1121876  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: ChatUP 1.0\n"
     5"Project-Id-Version: ChatUP 1.1\n"
    66"Report-Msgid-Bugs-To: http://wordpress.org/tag/chatup\n"
    77"POT-Creation-Date: 2014-09-27 13:43:06+00:00\n"
     
    3939msgstr "Campagna (ottieni il tuo codice da"
    4040
     41msgid "Hide chat icon when no operators are available"
     42msgstr "Nascondi icona se non ci sono operatori disponibili"
     43
     44msgid "Image URL for operator online [optional]"
     45msgstr "URL dell'immagine per operatore online [opzionale]"
     46
     47msgid "Image URL for operator offline (no operators available) [optional]"
     48msgstr "URL dell'immagine per operatore offline [opzionale]"
     49
     50msgid "If not absolute, relative to this site"
     51msgstr "Se non assoluto, relativo a questo sito"
     52
    4153#: includes/settings-page.php:96
    4254msgid "Save"
  • chatup/trunk/readme.txt

    r1121852 r1121876  
    44Requires at least: 3.8.5
    55Tested up to: 4.1.1
    6 Stable tag: 1.0
     6Stable tag: 1.1
    77License: GPLv2
    88
     
    6161= 1.0 =
    6262* Initial version
     63
     64= 1.1 =
     65* Added options (hide unavailable, custom image urls)
  • chatup/trunk/settings.php

    r1121158 r1121876  
    1818                <?php settings_fields('chatup'); ?>
    1919                <div class="inside">
     20
    2021                    <p><strong><?php _e('Campaign (obtain yours from','chatup'); ?> <a href='//chatup.it' target='_blank'>http://chatup.it/</a>):</strong></p>
    2122                    <p><input type="number" min="1" max="9999" name="chatup_campaign" value="<?php echo $this->__options['campaign']; ?>" /></p>
     23
     24                    <p><strong><?php _e('Hide chat icon when no operators are available', 'chatup'); ?> (offline):</strong></p>
     25                    <p><input type="checkbox" name="chatup_hide_na" value="true" <?php echo ($this->__options['hide_na'])?'checked':''; ?> /></p>
     26
     27                    <p><strong><?php _e('Image URL for operator online [optional]', 'chatup'); ?>:</strong></p>
     28                    <p><input type="text" name="chatup_online_img" value="<?php echo $this->__options['online_img']; ?>" size=40 /><br>
     29            <i><?PHP _e('If not absolute, relative to this site'); ?></i></p>
     30
     31                    <p><strong><?php _e('Image URL for operator offline (no operators available) [optional]', 'chatup'); ?>:</strong></p>
     32                    <p><input type="text" name="chatup_offline_img" value="<?php echo $this->__options['offline_img']; ?>" size=40 /><br>
     33            <i><?PHP _e('If not absolute, relative to this site'); ?></i></p>
     34
    2235                    <?php submit_button(__('Save','chatup'),'primary','submit',false); ?>
    2336            <br>
Note: See TracChangeset for help on using the changeset viewer.