Changeset 1491 for branches

Show
Ignore:
Timestamp:
06/12/06 18:33:33 (2 years ago)
Author:
spetersen
Message:

Update PostgreSQL branch to SVN change 1484.

Location:
branches/postgresql
Files:
3 added
6 modified
1 copied

Legend:

Unmodified
Added
Removed
  • branches/postgresql/cls/categories.php

    r1255 r1491  
    9696            if (array_key_exists(COLLAPSED_CATEGORIES_COOKIE, $_COOKIE)) { 
    9797                $this->collapsed_ids = explode(":", $_COOKIE[COLLAPSED_CATEGORIES_COOKIE]); 
     98            } elseif (empty($this->collapsed_ids) && getConfig("rss.output.channelcollapsedefault")) { 
     99               // Lets collapse all categories 
     100               $res = rss_query("select distinct(tid) from " . getTable('metatag') . " where ttype='channel'"); 
     101               while (list ($this->collapsed_ids[]) = rss_fetch_row($res)) { 
     102               } 
     103               if (!headers_sent()) { // Sajax does not allow us to set cookies 
     104                setcookie(COLLAPSED_CATEGORIES_COOKIE,  
     105                   implode(":", $this->collapsed_ids ) , time()+COOKIE_LIFESPAN,getPath()); 
     106               } 
    98107            } 
    99108 
  • branches/postgresql/cls/channels.php

    r1255 r1491  
    205205            if (array_key_exists(COLLAPSED_FOLDERS_COOKIE, $_COOKIE)) { 
    206206                $this->collapsed_ids = explode(":", $_COOKIE[COLLAPSED_FOLDERS_COOKIE]); 
    207             } 
    208      
    209             //get unread count per folder 
     207            }  elseif (empty($this->collapsed_ids) && getConfig("rss.output.channelcollapsedefault")) { 
     208               // Lets collapse all folders 
     209               $res = rss_query("select id from " . getTable('folders') . " where id != 0"); 
     210               while (list ($this->collapsed_ids[]) = rss_fetch_row($res)) { 
     211               } 
     212               if (!headers_sent()) { // Sajax does not allow us to set cookies 
     213                setcookie(COLLAPSED_FOLDERS_COOKIE,  
     214                  implode(":", $this->collapsed_ids ) , time()+COOKIE_LIFESPAN,getPath()); 
     215               } 
     216            } 
    210217     
    211218            //get unread count per folder                                                                         
  • branches/postgresql/cls/update.php

    r1484 r1491  
    259259        echo "</table>\n"; 
    260260        echo "<script type=\"text/javascript\">\n"; 
    261         echo "for (k =0; k < " . AJAX_PARALLEL_SIZE . "; k++){\n"; 
    262         echo "doUpdate();}\n</script>\n"; 
     261        echo "function runAjaxUpdate() { \n"; 
     262        echo "    for (k =0; k < " . AJAX_PARALLEL_SIZE . "; k++){\n"; 
     263        echo "    doUpdate();\n"; 
     264        echo "    }\n"; 
     265        echo "}\n"; 
     266        // Fix for IE's stupid "Operation Aborted" Error 
     267        echo "   if (window.addEventListener) window.addEventListener(\"load\",runAjaxUpdate,false); else if (window.attachEvent) window.attachEvent(\"onload\",runAjaxUpdate);\n"; 
     268        echo "</script>\n"; 
    263269    } 
    264270} 
  • branches/postgresql/dbstruct.pgsql.sql

    r1484 r1491  
    267267insert into config (key_,value_,default_,type_,desc_,export_) values ('rss.config.defaultdashboard', '1', '1','boolean','If the first page seen when entering the admin section should be the dashboard',NULL); 
    268268insert into config (key_,value_,default_,type_,desc_,export_) values ('rss.output.nav.unread', 'false', 'false','boolean','If the navigation hints on the feeds page should go to the next feed with unread items.  If false, it simply goes to the next feed.',NULL); 
     269insert into config (key_,value_,default_,type_,desc_,export_) values ('rss.output.channelcollapsedefault', 'false','false','boolean','Collapse the channels on the main page by default',NULL); 
    269270 
    270271INSERT INTO  dashboard  (title, url, position, obj, daterefreshed, itemcount) VALUES  ('Latest Gregarius News', 'http://devlog.gregarius.net/feed/?db=', '0', '', null, 3); 
  • branches/postgresql/extlib/kses.php

    r392 r1491  
    241241      case 2: # attribute value, a URL after href= for instance 
    242242 
    243         if (preg_match('/^"([^"]*)"(\s+|$|\/)/', $attr, $match)) 
     243        if (preg_match('/^"([^"]*)"(\s+|$|\/)?/', $attr, $match)) 
    244244         # "value" 
    245245        { 
     
    252252                         'vless' => 'n'); 
    253253          $working = 1; $mode = 0; 
    254           $attr = preg_replace('/^"[^"]*"(\s+|$|\/)/', '', $attr); 
     254          $attr = preg_replace('/^"[^"]*"(\s+|$|\/)?/', '', $attr); 
    255255          break; 
    256256        } 
    257257 
    258         if (preg_match("/^'([^']*)'(\s+|$|\/)/", $attr, $match)) 
     258        if (preg_match("/^'([^']*)'(\s+|$|\/)?/", $attr, $match)) 
    259259         # 'value' 
    260260        { 
     
    267267                         'vless' => 'n'); 
    268268          $working = 1; $mode = 0; 
    269           $attr = preg_replace("/^'[^']*'(\s+|$)/", '', $attr); 
     269          $attr = preg_replace("/^'[^']*'(\s+|$)?/", '', $attr); 
    270270          break; 
    271271        } 
  • branches/postgresql/schema.php

    r1484 r1491  
    437437        "rss.output.compression"    =>      array("true","true","boolean","This variable turns output compression on and off. Output compression is handled by most browsers.",NULL), 
    438438        "rss.output.channelcollapse"=>  array("true","true","boolean","Allow collapsing of channels on the main page. ",NULL), 
     439        "rss.output.channelcollapsedefault"=>   array("false","false","boolean","Collapse the channels on the main page by default",NULL), 
    439440        "rss.output.usepermalinks"  =>      array("true","true","boolean","Display a permalink icon and allow linking a given item directly.",NULL), 
    440441        "rss.config.markreadonupdate"=> array("false","false","boolean","Mark all old unread feeds as read when updating if new unread feeds are found.",NULL),