Plugin Directory

Changeset 1381583


Ignore:
Timestamp:
03/30/2016 01:16:47 AM (10 years ago)
Author:
LRHGuy
Message:

Updated ajax usage.

Location:
omt-on-air/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • omt-on-air/trunk

    • Property svn:ignore set to
      __history
  • omt-on-air/trunk/readme.txt

    r1285800 r1381583  
    6363== Changelog ==
    6464
     65= 1.4.0 =
     66* Maintenance.
     67* Changed ajax update interval default to 20 seconds
     68* Changed ajax call to use internal object, fewer parameters
     69
     70= 1.3.0 =
     71* Maintenance.
     72* Addition of option to not show album data
     73* Addition of option to show a number of recently played cuts
     74* Addition of option to limit cuts displayed to a category
     75
    6576= 1.2.3 =
    66 
    6777* Maintenance.
    6878* Addition of footer line.
    6979
    7080= 1.2.0 =
    71 
    7281* Maintenance update.
    7382
     
    8190* This is the initial version. You'll like it.
    8291
    83 = 1.2.3 =
    84 * Maintenance.
    85 * Addition of footer line.
    86 
    87 = 1.3.0 =
    88 * Maintenance.
    89 * Addition of option to not show album data
    90 * Addition of option to show a number of recently played cuts
    91 * Addition of option to limit cuts displayed to a category
    92 
    9392== Upgrade Notice ==
    9493
    95 = 1.3.0 =
     94= 1.4.0 =
    9695* Maintenance.
    97 * Addition of option to not show album data
    98 * Addition of option to show a number of recently played cuts
    99 * Addition of option to limit cuts displayed to a category
     96* Changed ajax update interval default to 20 seconds
     97* Changed ajax call to use internal object, fewer parameters
  • omt-on-air/trunk/wp.widget_lrhomtonair.php

    r1285796 r1381583  
    55Description: Retrieves the OMT/iMediaTouch OnAir xml file and displays the active cut.
    66Author: Larry Houbre, Jr.
    7 Version: 1.3.0
     7Version: 1.4.0
    88*/
    99
     
    2323define('cwidgetoption_lrhomtonair_useajax','lrhomtonair_ua');
    2424define('cwidgetoption_lrhomtonair_useintervalsecs','lrhomtonair_is');
    25 define('cwidgetoption_lrhomtonair_useintervalsecs_value','2.5');
     25define('cwidgetoption_lrhomtonair_useintervalsecs_value','20');
    2626define('cwidgetoption_lrhomtonair_ajaxload','lrhomtonair_al');
    2727define('cwidgetoption_lrhomtonair_ajaxload_value',__('Loading...',cwidgetbaseid_lrhomtonair));
     
    3232
    3333define('cwidgetajax_lrhomtonair_request','lrhomtonair_ar');
    34 define('cwidgetajax_lrhomtonair_request_update','update');
    35 define('cwidgetajax_lrhomtonair_url','lrhomtonair_au');
    36 define('cwidgetajax_lrhomtonair_defpgm','lrhomtonair_ad');
    37 define('cwidgetajax_lrhomtonair_usediv','lrhomtonair_ud');
    38 define('cwidgetajax_lrhomtonair_showalbum','lrhomtonair_salb');
    39 define('cwidgetajax_lrhomtonair_cats','lrhomtonair_cats');
    40 define('cwidgetajax_lrhomtonair_prevcount','lrhomtonair_pcnt');
    4134define('cwidgetajax_lrhomtonair_nonce','lrhomtonair_an');
    4235
     
    4437class lrh_widget_omtonair extends LRH_WPWidget {
    4538
    46     function __construct()
    47     {
    48         $n=__(cwidgetname_lrhomtonair,cwidgetbaseid_lrhomtonair);
    49         $d=__('Retrieves the OMT/iMediaTouch OnAir xml file and displays the active cut.',cwidgetbaseid_lrhomtonair);
    50         parent::__construct('bi_'.cwidgetbaseid_lrhomtonair,cwidgetbaseid_lrhomtonair,$n,$d);
    51 
    52         //Register option fields
    53         $this->RegisterOptionField('title'
    54                         ,__('Title:',cwidgetbaseid_lrhomtonair)
    55                         ,'','text');
    56         $this->RegisterOptionField(cwidgetoption_lrhomtonair_defaultprogram
    57                         ,__('Default Program:',cwidgetbaseid_lrhomtonair)
    58                         ,'','text');
    59         $this->RegisterOptionField(cwidgetoption_lrhomtonair_xmlurl
    60                         ,__('Location of OMT XML file: (required)',cwidgetbaseid_lrhomtonair)
    61                         ,'','text');
    62         $this->RegisterOptionField(cwidgetoption_lrhomtonair_useajax
    63                         ,__('Use Ajax:',cwidgetbaseid_lrhomtonair)
    64                         ,'0','yesnoselect');
    65         $this->RegisterOptionField(cwidgetoption_lrhomtonair_useintervalsecs
    66                         ,__('Ajax update interval, seconds:',cwidgetbaseid_lrhomtonair)
    67                         ,cwidgetoption_lrhomtonair_useintervalsecs_value,'text');
    68         $this->RegisterOptionField(cwidgetoption_lrhomtonair_ajaxload
    69                         ,__('"Loading" notice:',cwidgetbaseid_lrhomtonair)
    70                         ,'','text');
    71         $this->RegisterOptionField(cwidgetoption_lrhomtonair_usediv
    72                         ,__('Output as non-list:',cwidgetbaseid_lrhomtonair)
    73                         ,'0','yesnoselect');
    74         $this->RegisterOptionField(cwidgetoption_lrhomtonair_foot
    75                         ,__('Footer text:',cwidgetbaseid_lrhomtonair)
    76                         ,'','text');
    77         $this->RegisterOptionField(cwidgetoption_lrhomtonair_showalbum
    78                         ,__('Show album:',cwidgetbaseid_lrhomtonair)
    79                         ,'1','yesnoselect');
    80         $this->RegisterOptionField(cwidgetoption_lrhomtonair_cats
    81                         ,__('Categorys:',cwidgetbaseid_lrhomtonair)
    82                         ,'','text');
    83         $this->RegisterOptionField(cwidgetoption_lrhomtonair_prevcount
    84                         ,__('Show recently played:',cwidgetbaseid_lrhomtonair)
    85                         ,'0','text');
    86 
    87         $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_defaultprogram
    88                 ,__('Used when there is no cut playing, or no data available. Default is ',cwidgetbaseid_lrhomtonair)
     39function __construct()
     40{
     41    $n=__(cwidgetname_lrhomtonair,cwidgetbaseid_lrhomtonair);
     42    $d=__('Retrieves the OMT/iMediaTouch OnAir xml file and displays the active cut.',cwidgetbaseid_lrhomtonair);
     43    parent::__construct('bi_'.cwidgetbaseid_lrhomtonair,cwidgetbaseid_lrhomtonair,$n,$d);
     44
     45    //Register option fields
     46    $this->RegisterOptionField('title'
     47                    ,__('Title:',cwidgetbaseid_lrhomtonair)
     48                    ,'','text');
     49    $this->RegisterOptionField(cwidgetoption_lrhomtonair_defaultprogram
     50                    ,__('Default Program:',cwidgetbaseid_lrhomtonair)
     51                    ,'','text');
     52    $this->RegisterOptionField(cwidgetoption_lrhomtonair_xmlurl
     53                    ,__('Location of OMT XML file: (required)',cwidgetbaseid_lrhomtonair)
     54                    ,'','text');
     55    $this->RegisterOptionField(cwidgetoption_lrhomtonair_useajax
     56                    ,__('Use Ajax:',cwidgetbaseid_lrhomtonair)
     57                    ,'0','yesnoselect');
     58    $this->RegisterOptionField(cwidgetoption_lrhomtonair_useintervalsecs
     59                    ,__('Ajax update interval, seconds:',cwidgetbaseid_lrhomtonair)
     60                    ,cwidgetoption_lrhomtonair_useintervalsecs_value,'text');
     61    $this->RegisterOptionField(cwidgetoption_lrhomtonair_ajaxload
     62                    ,__('"Loading" notice:',cwidgetbaseid_lrhomtonair)
     63                    ,'','text');
     64    $this->RegisterOptionField(cwidgetoption_lrhomtonair_usediv
     65                    ,__('Output as non-list:',cwidgetbaseid_lrhomtonair)
     66                    ,'0','yesnoselect');
     67    $this->RegisterOptionField(cwidgetoption_lrhomtonair_foot
     68                    ,__('Footer text:',cwidgetbaseid_lrhomtonair)
     69                    ,'','text');
     70    $this->RegisterOptionField(cwidgetoption_lrhomtonair_showalbum
     71                    ,__('Show album:',cwidgetbaseid_lrhomtonair)
     72                    ,'1','yesnoselect');
     73    $this->RegisterOptionField(cwidgetoption_lrhomtonair_cats
     74                    ,__('Categorys:',cwidgetbaseid_lrhomtonair)
     75                    ,'','text');
     76    $this->RegisterOptionField(cwidgetoption_lrhomtonair_prevcount
     77                    ,__('Show recently played:',cwidgetbaseid_lrhomtonair)
     78                    ,'0','text');
     79
     80    $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_defaultprogram
     81            ,__('Used when there is no cut playing, or no data available. Default is ',cwidgetbaseid_lrhomtonair)
    8982                .cwidgetoption_lrhomtonair_defaultprogram_value);
    90         $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_xmlurl
    91                 ,__('Use file:://path if the file resides on the host system.',cwidgetbaseid_lrhomtonair));
    92         $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_useajax
    93                 ,__('Keeps status updated, every interval seconds.',cwidgetbaseid_lrhomtonair));
    94         $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_useintervalsecs
    95                 ,__('When using ajax, update this often, in seconds. Default is ',cwidgetbaseid_lrhomtonair)
     83    $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_xmlurl
     84            ,__('Use file:://path if the file resides on the host system.',cwidgetbaseid_lrhomtonair));
     85    $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_useajax
     86            ,__('Keeps status updated, every interval seconds.',cwidgetbaseid_lrhomtonair));
     87    $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_useintervalsecs
     88            ,__('When using ajax, update this often, in seconds. Default is ',cwidgetbaseid_lrhomtonair)
    9689                .cwidgetoption_lrhomtonair_useintervalsecs_value);
    97         $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_ajaxload
    98                 ,__('Text shown while waiting for initial ajax response.',cwidgetbaseid_lrhomtonair));
    99         $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_usediv
    100                 ,__('Do not use an unnumbered list in display text, use div instead.',cwidgetbaseid_lrhomtonair));
    101         $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_cats
    102                 ,__('[optional] List categorys to show, comma separated.'
    103                     .' (Or, start list with a minus "-" to NOT show these categorys.)'
    104                     ,cwidgetbaseid_lrhomtonair)
    105                 );
    106         $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_prevcount
    107                 ,__('Number of recently played cuts to show, normally none. '
    108                     .' (Set to -1 to show one if nothing playing can be displayed)'
    109                 ,cwidgetbaseid_lrhomtonair)
    110                 );
    111 
    112         // Make sure jQuery is available
    113         // already always included in WP 2.x ??
    114         wp_enqueue_script('jquery');
    115     }
    116 
    117     function widget( $args, $instance ) {
    118         // If no URL, don't bother
    119         $URL=$instance[cwidgetoption_lrhomtonair_xmlurl];
    120         if (empty($URL)) return;
    121 
    122         extract($args);
    123         $title = apply_filters('widget_title'
    124             ,empty($instance['title']) ? $this->name : $instance['title']
    125             ,$instance
    126             ,$this->id_base
     90    $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_ajaxload
     91            ,__('Text shown while waiting for initial ajax response.',cwidgetbaseid_lrhomtonair));
     92    $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_usediv
     93            ,__('Do not use an unnumbered list in display text, use div instead.',cwidgetbaseid_lrhomtonair));
     94    $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_cats
     95            ,__('[optional] List categorys to show, comma separated.'
     96                .' (Or, start list with a minus "-" to NOT show these categorys.)'
     97            ,cwidgetbaseid_lrhomtonair)
    12798            );
     99    $this->RegisterFieldHelp(cwidgetoption_lrhomtonair_prevcount
     100            ,__('Number of recently played cuts to show, normally none. '
     101                .' (Set to -1 to show one if nothing playing can be displayed)'
     102            ,cwidgetbaseid_lrhomtonair)
     103            );
     104
     105    // Make sure jQuery is available
     106    // already always included in WP 2.x ??
     107    wp_enqueue_script('jquery');
     108
     109    // add in ajax handler in case we need it
     110    add_action('wp_ajax_'.cwidgetajax_lrhomtonair_request,array($this,'ajaxhandler'));
     111    add_action('wp_ajax_nopriv_'.cwidgetajax_lrhomtonair_request,array($this,'ajaxhandler'));
     112}
     113
     114function widget( $args, $instance ) {
     115    // If no URL, don't bother
     116    $URL=$instance[cwidgetoption_lrhomtonair_xmlurl];
     117    if (empty($URL)) return;
     118
     119    extract($args);
     120    $title = apply_filters('widget_title'
     121        ,empty($instance['title']) ? $this->name : $instance['title']
     122        ,$instance
     123        ,$this->id_base
     124        );
    128125
    129126        $useajax=('1'==$instance[cwidgetoption_lrhomtonair_useajax]);
    130         $defpgm=$instance[cwidgetoption_lrhomtonair_defaultprogram];
    131127        $footer=$instance[cwidgetoption_lrhomtonair_foot];
    132128        $usediv=('1'==$instance[cwidgetoption_lrhomtonair_usediv]);
    133         $showalbum=('1'==$instance[cwidgetoption_lrhomtonair_showalbum]);
    134         $cats=trim($instance[cwidgetoption_lrhomtonair_cats]);
    135         $prevcnt=intval($instance[cwidgetoption_lrhomtonair_prevcount]);
    136129
    137130        if ($useajax) {
     
    150143            . '  url:"'.$jurl.'",'."\r\n"
    151144            . '  data:{action:"'.cwidgetajax_lrhomtonair_request.'"'."\r\n"
    152             . '   ,'.cwidgetajax_lrhomtonair_request.':"'.cwidgetajax_lrhomtonair_request_update.'"'."\r\n"
    153             . '   ,'.cwidgetajax_lrhomtonair_url.':"'.$URL.'"'."\r\n"
    154             . '   ,'.cwidgetajax_lrhomtonair_defpgm.':"'.$defpgm.'"'."\r\n"
    155             . '   ,'.cwidgetoption_lrhomtonair_usediv.':"'.$usediv.'"'."\r\n"
    156             . '   ,'.cwidgetajax_lrhomtonair_showalbum.':"'.$showalbum.'"'."\r\n"
    157             . '   ,'.cwidgetajax_lrhomtonair_cats.':"'.$cats.'"'."\r\n"
    158             . '   ,'.cwidgetajax_lrhomtonair_prevcount.':"'.$prevcnt.'"'."\r\n"
    159145            . '   ,'.cwidgetajax_lrhomtonair_nonce.':"'.$nonce.'"'."\r\n"
    160146            . '   },'."\r\n"
     
    178164            . '</script>';
    179165        } else {
    180             $show=lrhomtonair_GetDisplayText($URL,$defpgm,$showalbum,$cats,$prevcnt,$usediv);
     166            $show=$this->GetDisplayText();
    181167            $script='';
    182168        }
    183169
    184         echo '<!-- '.cwidgetbaseid_lrhomtonair.' '.$this->GetPluginVersion(__FILE__).' -->';
    185         echo $before_widget;
    186         if ( $title )
    187             echo $before_title.$title.$after_title;
    188         if ($usediv) echo '<div';
    189         else         echo '<ul';
    190         echo " id='{$widget_id}_onair' class='".cwidgetbaseid_lrhomtonair."_content'>$show</";
    191         if ($usediv) echo 'div>';
    192         else         echo 'ul>';
    193         if ($footer) {
    194             echo (($usediv)?"<div":"<p")
    195                 ." class='".cwidgetbaseid_lrhomtonair."_footer'>"
    196                 .$footer.(($usediv)?'</div>':'</p>');
    197         }
    198         echo $after_widget;
    199         print $script;
    200     }
    201 
    202     function FormBeforeFields($aInstance)
    203     {
    204         parent::FormBeforeFields($aInstance);
    205         echo $this->form_info(
    206             __('Version',cwidgetbaseid_lrhomtonair)
     170    echo '<!-- '.cwidgetbaseid_lrhomtonair.' '.$this->GetPluginVersion(__FILE__).' -->';
     171    echo $before_widget;
     172    if ( $title )
     173        echo $before_title.$title.$after_title;
     174    if ($usediv) echo '<div';
     175    else         echo '<ul';
     176    echo " id='{$widget_id}_onair' class='".cwidgetbaseid_lrhomtonair."_content'>$show</";
     177    if ($usediv) echo 'div>';
     178    else         echo 'ul>';
     179    if ($footer) {
     180        echo (($usediv)?"<div":"<p")
     181            ." class='".cwidgetbaseid_lrhomtonair."_footer'>"
     182            .$footer.(($usediv)?'</div>':'</p>');
     183    }
     184    echo $after_widget;
     185    print $script;
     186}
     187
     188function FormBeforeFields($aInstance)
     189{
     190    parent::FormBeforeFields($aInstance);
     191    echo $this->form_info
     192        (__('Version',cwidgetbaseid_lrhomtonair)
    207193            .': '.$this->GetPluginVersion(__FILE__)
    208             );
    209     }
    210 
    211 }//class
    212 
    213 
    214 // To support the AJAX calls, these need to be OUTSIDE of the widget class
    215 function lrhomtonair_GetOnAirData($aUrl,$aCats) {
     194        );
     195}
     196
     197function ajaxhandler()
     198{
     199    check_ajax_referer(cwidgetbaseid_lrhomtonair,cwidgetajax_lrhomtonair_nonce);
     200    echo $this->GetDisplayText();
     201    die();
     202}
     203
     204function GetOnAirData($aUrl,$aCats)
     205{
    216206//echo "|$aUrl|<br>|$aCats|<br>";
    217207    if ('file://'==substr($aUrl,0,7)) {
     
    219209        if (file_exists($aUrl)) {
    220210            $content=file_get_contents($aUrl);
    221             if ($content=='') return lrhomtonair_DataError('File:no content'); //nothing
     211            if ($content=='') return $this->DataError('File:no content'); //nothing
    222212        } else {
    223             return lrhomtonair_DataError('File:not found'); //nothing
     213            return $this->DataError('File:not found'); //nothing
    224214        }
    225215    } else {
     
    227217        if ('http://'!=substr($aUrl,0,7)) $aUrl='http://'.$aUrl;
    228218        $content=wp_remote_retrieve_body(wp_remote_get($aUrl));
    229         if ($content=='') return lrhomtonair_DataError('Http:no content'); //nothing
     219        if ($content=='') return $this->DataError('Http:no content'); //nothing
    230220    }
    231221    //convert xml to data array
     
    233223        @$x=new SimpleXMLElement($content);
    234224    } catch (Exception $e) {
    235         return lrhomtonair_DataError('XML error:'.$e->getMessage(),$content); //trouble
     225        return $this->DataError('XML error:'.$e->getMessage(),$content); //trouble
    236226    }
    237227
     
    288278}
    289279
    290 function lrhomtonair_DataError($aMsg,$aMsg2='') {
     280function DataError($aMsg,$aMsg2='')
     281{
    291282    if (WP_DEBUG) {
    292283        //for debugging
     
    300291}
    301292
    302 function lrhomtonair_FormatItem(array $aItem,$aShowAlbum,$aUseDiv)
     293function FormatItem(array $aItem,$aShowAlbum,$aUseDiv)
    303294{
    304295    $show='';
     
    310301}
    311302
    312 function lrhomtonair_GetDisplayText($aUrl,$aDefaultProgram,$aShowAlbum,$aCats,$aPrevCnt,$aUseDiv) {
    313     $ONAIR=lrhomtonair_GetOnAirData($aUrl,$aCats);
     303function GetDisplayText()
     304{
     305    $a=$this->get_settings();
     306    $s=$a[$this->number];
     307    $aUrl              =$s[cwidgetoption_lrhomtonair_xmlurl];
     308    $aDefaultProgram   =$s[cwidgetoption_lrhwumdonair_defaultprogram];
     309    $aShowAlbum        =('1'==$s[cwidgetoption_lrhomtonair_showalbum]);
     310    $aCats             =trim($s[cwidgetoption_lrhomtonair_cats]);
     311    $aPrevCnt          =intval($s[cwidgetoption_lrhomtonair_prevcount]);
     312    $aUseDiv           =('1'==$s[cwidgetoption_lrhomtonair_usediv]);
     313
     314    $ONAIR=$this->GetOnAirData($aUrl,$aCats);
    314315    $pc=count($ONAIR['prev']);
    315316//echo "<pre>|$aUrl|$aDefaultProgram|$aShowAlbum|$aPrevCnt|$aUseDiv|$aCats|$pc|\r\n</pre>";
    316317//echo "<pre>ONAIR DATA:\r\n"; print_r($ONAIR); echo "</pre>";
    317318    if (isset($ONAIR['now'][0])) {
    318         $show=lrhomtonair_FormatItem($ONAIR['now'][0],$aShowAlbum,$aUseDiv);
     319        $show=$this->FormatItem($ONAIR['now'][0],$aShowAlbum,$aUseDiv);
    319320    } else {
    320321        if ( (0==$aPrevCnt) || (0==$pc) ) {
    321322            $show=$aDefaultProgram;
    322323            if (empty($show)) $show=cwidgetoption_lrhomtonair_defaultprogram_value;
    323             $show=lrhomtonair_FormatItem(array('Title'=>$show),$aShowAlbum,$aUseDiv);
     324            $show=$this->FormatItem(array('Title'=>$show),$aShowAlbum,$aUseDiv);
    324325        } else if (-1==$pc) {
    325326            reset($ONAIR['prev']);
    326             $show=lrhomtonair_FormatItem(current($ONAIR['prev']),$aShowAlbum,$aUseDiv);
     327            $show=$this->FormatItem(current($ONAIR['prev']),$aShowAlbum,$aUseDiv);
    327328        }
    328329    }
     
    330331        $cnt=$aPrevCnt;
    331332        foreach($ONAIR['prev'] as $item) {
    332             $show.=lrhomtonair_FormatItem($item,$aShowAlbum,$aUseDiv);
     333            $show.=$this->FormatItem($item,$aShowAlbum,$aUseDiv);
    333334            if (0==--$cnt) break;
    334335        }
     
    338339}
    339340
    340 function lrhomtonair_ajaxhandler() {
    341     if (WP_DEBUG) error_log('loo handler');
    342     if (!empty($_POST[cwidgetajax_lrhomtonair_request])) {
    343         //check_ajax_referer does not return if check fails
    344         check_ajax_referer(cwidgetbaseid_lrhomtonair,cwidgetajax_lrhomtonair_nonce);
    345         $REQ=strip_tags($_POST[cwidgetajax_lrhomtonair_request]);
    346         if ($REQ==cwidgetajax_lrhomtonair_request_update) {
    347             $URL=strip_tags($_POST[cwidgetajax_lrhomtonair_url]);
    348             $DEFPGM=strip_tags($_POST[cwidgetajax_lrhomtonair_defpgm]);
    349             $USEDIV='1'==strip_tags($_POST[cwidgetajax_lrhomtonair_usediv]);
    350             $SHOWALBUM='1'==strip_tags($_POST[cwidgetajax_lrhomtonair_showalbum]);
    351             $CATS=strip_tags($_POST[cwidgetajax_lrhomtonair_cats]);
    352             $PRVCNT=intval(strip_tags($_POST[cwidgetajax_lrhomtonair_prevcount]));
    353             echo lrhomtonair_GetDisplayText($URL,$DEFPGM,$SHOWALBUM,$CATS,$PRVCNT,$USEDIV);
    354             die();
    355         }
    356     }
    357     echo "Trouble in<br>AJAX<br>land.";
    358 }
     341}//class
     342
    359343
    360344add_action('widgets_init'
    361345    ,create_function('','return register_widget("lrh_widget_omtonair");')
    362346    );
    363 add_action('wp_ajax_'.cwidgetajax_lrhomtonair_request,'lrhomtonair_ajaxhandler');
    364 add_action('wp_ajax_nopriv_'.cwidgetajax_lrhomtonair_request,'lrhomtonair_ajaxhandler');
    365347
    366348?>
Note: See TracChangeset for help on using the changeset viewer.