Changeset 1662

Show
Ignore:
Timestamp:
01/07/07 20:33:04 (23 months ago)
Author:
mbonetti
Message:

AJAX powered feed subscription, which is the first step to clean up the OPML
import.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/ajax.php

    r1658 r1662  
    115115 
    116116 
     117function __exp_addChannel($url, $folderid = 0, $title_=null,$descr_=null,$tags = null) { 
     118    rss_require('extlib/JSON.php'); 
     119    $json = new SERVICES_JSON(); 
     120    if (!isset($GLOBALS['rssuser'])) { 
     121        require_once('cls/user.php'); 
     122    } 
     123    if(rss_user_check_user_level(RSS_USER_LEVEL_PRIVATE)) { 
     124        $ret = add_channel($url, $folderid, $title_,$descr_,$tags); 
     125    } else { 
     126        $ret = array (-1, "Sorry, you are not privileged enough to add feeds"); 
     127    } 
     128     
     129    return $json -> encode($ret); 
     130} 
     131 
    117132$sajax_request_type = "POST"; 
    118133$sajax_debug_mode = 0; 
     
    120135 
    121136// Non standard! One usually calls sajax_export() ... 
    122 $sajax_export_list = array("__exp__submitTag","__exp__getSideContent","__exp__getFeedContent"); 
     137$sajax_export_list = array("__exp__submitTag","__exp__getSideContent","__exp__getFeedContent", "__exp_addChannel"); 
    123138 
    124139// Plugins shall export ajax functions as well