rpms/zikula-module-filterutil/EL-5 filterutil-separate-module.patch, NONE, 1.1 filterutil-style-bugfix-zikula-trunk.patch, NONE, 1.1 zikula-module-filterutil.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Toshio くらとみ toshio at fedoraproject.org
Wed Oct 21 20:04:37 UTC 2009


Author: toshio

Update of /cvs/pkgs/rpms/zikula-module-filterutil/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10290

Modified Files:
	.cvsignore sources 
Added Files:
	filterutil-separate-module.patch 
	filterutil-style-bugfix-zikula-trunk.patch 
	zikula-module-filterutil.spec 
Log Message:
initial import:

* Thu Sep 17 2009 Toshio Kuratomi <toshio at fedoraproject.org> - 0-0.2.20090915svn15
- Add fixes from itbegins for putting this in its own zikula directory


filterutil-separate-module.patch:
 FilterUtil.class.php |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE filterutil-separate-module.patch ---
Index: filterutil-0/FilterUtil.class.php
===================================================================
--- filterutil-0.orig/FilterUtil.class.php
+++ filterutil-0/FilterUtil.class.php
@@ -13,7 +13,7 @@
 /**
  * Define Class path
  */
-define('FILTERUTIL_CLASS_PATH', 'includes/pnobjlib/FilterUtil');
+define('FILTERUTIL_CLASS_PATH', 'config/classes/FilterUtil');
 
 Loader::loadClass('FilterUtil_Plugin', FILTERUTIL_CLASS_PATH);
 Loader::loadClass('FilterUtil_PluginCommon', FILTERUTIL_CLASS_PATH);

filterutil-style-bugfix-zikula-trunk.patch:
 FilterUtil_Common.class.php         |   16 ++++++++--------
 FilterUtil_Plugin.class.php         |    8 ++++----
 filter/filter.category.class.php    |   17 +++++++++++------
 filter/filter.date.class.php        |   29 ++++++++++++++++++-----------
 filter/filter.default.class.php     |   15 +++++++++------
 filter/filter.replaceName.class.php |   11 +++++++----
 6 files changed, 57 insertions(+), 39 deletions(-)

--- NEW FILE filterutil-style-bugfix-zikula-trunk.patch ---
Index: FilterUtil/filter/filter.default.class.php
===================================================================
--- FilterUtil/filter/filter.default.class.php	(revision 15)
+++ FilterUtil/filter/filter.default.class.php	(working copy)
@@ -40,7 +40,7 @@
     		$this->activateOperators(array('eq', 'ne', 'lt', 'le', 'gt', 'ge', 'like', 'null', 'notnull'));
     	}
     	
-	    if ($config['default'] == true || count($this->fields) <= 0) {
+    	if ((isset($config['default']) && $config['default'] == true) || count($this->fields) <= 0) {
     		$this->default = true;
     	}
 	}
@@ -55,8 +55,9 @@
     {
         static $ops = array('eq', 'ne', 'lt', 'le', 'gt', 'ge', 'like', 'null', 'notnull');
     	if (is_array($op)) {
-    		foreach($op as $v)
+    		foreach ($op as $v) {
     			$this->activateOperators($v);
+    		}
     	} elseif (!empty($op) && array_search($op, $this->ops) === false && array_search($op, $ops) !== false) {
     		$this->ops[] = $op;
     	}
@@ -65,15 +66,17 @@
     public function addFields($fields)
     {
     	if (is_array($fields)) {
-    		foreach($fields as $fld)
+    		foreach ($fields as $fld) {
     			$this->addFields($fld);
+    		}
     	} elseif (!empty($fields) && $this->fieldExists($fields) 
     	        && array_search($fields, $this->fields) === false) {
     		$this->fields[] = $fields;
     	}
     }
     
-    public function getFields() {
+    public function getFields()
+    {
         return $this->fields;
     }
     
@@ -111,7 +114,7 @@
 	    }
 		switch ($op) {
 		case 'ne':
-			return array('where' => $this->column[$field]." <> '" . $value . "'");
+			return array('where' => $this->column[$field] . " != '" . $value . "'");
 			break;
 		case 'lt':
 			return array('where' => $this->column[$field]." < '" . $value . "'");
@@ -132,7 +135,7 @@
 			return array('where' => $this->column[$field]." = '' OR ".$this->column[$field]." IS NULL");
 			break;
 		case 'notnull':
-			return array('where' => $this->column[$field]." <> '' AND ".$this->column[$field]." IS NOT NULL");
+			return array('where' => $this->column[$field] . " != '' AND " . $this->column[$field] . " IS NOT NULL");
 			break;
 		case 'eq':
 			return array('where' => $this->column[$field]." = '" . $value . "'");
Index: FilterUtil/filter/filter.replaceName.class.php
===================================================================
--- FilterUtil/filter/filter.replaceName.class.php	(revision 15)
+++ FilterUtil/filter/filter.replaceName.class.php	(working copy)
@@ -27,8 +27,9 @@
 	public function __construct($config)
 	{
 		parent::__construct($config);
-		if (isset($config['pair']) && is_array($config['pair']))
+		if (isset($config['pair']) && is_array($config['pair'])) {
 		    $this->addPair($config['pair']);
+		}
 	}
 	
 	/**
@@ -37,12 +38,14 @@
 	 * @param mixed $pair Replace Pair
 	 * @access public
 	 */
-	public function addPair($pair) {
+	public function addPair($pair)
+	{
 	    foreach ($pair as $f => $r) {
-	        if (is_array($r))
+	        if (is_array($r)) {
 	            $this->addPair($r);
-	        else
+	        } else {
 	            $this->pair[$f] = $r;
+	        }
 	    }
 	}
 
Index: FilterUtil/filter/filter.category.class.php
===================================================================
--- FilterUtil/filter/filter.category.class.php	(revision 15)
+++ FilterUtil/filter/filter.category.class.php	(working copy)
@@ -53,14 +53,16 @@
     public function addFields($fields)
     {
     	if (is_array($fields)) {
-    		foreach($fields as $fld)
+    		foreach ($fields as $fld) {
     			$this->addFields($fld);
+    		}
     	} elseif (!empty($fields) && !$this->fieldExists($fields) && array_search($fields, $this->fields) === false) {
     		$this->fields[] = $fields;
     	}
     }
     
-    public function getFields() {
+    public function getFields()
+    {
         return $this->fields;
     }
     
@@ -73,8 +75,9 @@
     public function activateOperators($op)
     {
     	if (is_array($op)) {
-    		foreach($op as $v)
+    		foreach ($op as $v) {
     			$this->activateOperators($v);
+    		}
     	} elseif (!empty($op) && array_search($op, $this->ops) === false && array_search($op, $this->availableOperators()) !== false) {
     		$this->ops[] = $op;
     	}
@@ -89,8 +92,9 @@
     public function getOperators()
     {
     	$fields = $this->getFields();
-    	if ($this->default == true)
+    	if ($this->default == true) {
     		$fields[] = '-';
+    	}
     	$ops = array();
     	foreach ($this->ops as $op) {
     		$ops[$op] = $fields;
@@ -104,7 +108,8 @@
      * @see CategoryUtil
      * @param mixed $property Category Property
      */
-	public function setProperty($property) {
+	public function setProperty($property)
+	{
 	    $this->property = (array) $property;
 	}
 
@@ -149,4 +154,4 @@
 		}
 		return array('where' => $where);
 	}
-}
\ No newline at end of file
+}
Index: FilterUtil/filter/filter.date.class.php
===================================================================
--- FilterUtil/filter/filter.date.class.php	(revision 15)
+++ FilterUtil/filter/filter.date.class.php	(working copy)
@@ -53,8 +53,9 @@
     public function activateOperators($op)
     {
     	if (is_array($op)) {
-    		foreach($op as $v)
+    		foreach ($op as $v) {
     			$this->activateOperators($v);
+    		}
     	} elseif (!empty($op) && array_search($op, $this->ops) === false && array_search($op, $this->availableOperators()) !== false) {
     		$this->ops[] = $op;
     	}
@@ -63,15 +64,17 @@
     public function addFields($fields)
     {
     	if (is_array($fields)) {
-    		foreach($fields as $fld)
+    		foreach ($fields as $fld) {
     			$this->addFields($fld);
+    		}
     	} elseif (!empty($fields) && $this->fieldExists($fields) 
     	        && array_search($fields, $this->fields) === false) {
     		$this->fields[] = $fields;
     	}
     }
     
-    public function getFields() {
+    public function getFields()
+    {
         return $this->fields;
     }
     
@@ -84,8 +87,9 @@
     public function getOperators()
     {
     	$fields = $this->getFields();
-    	if ($this->default == true)
+    	if ($this->default == true) {
     		$fields[] = '-';
+    	}
     	$ops = array();
     	foreach ($this->ops as $op) {
     		$ops[$op] = $fields;
@@ -142,7 +146,8 @@
 		return $time;
 	}
 	
-	private function makePeriod($date, $type) {
+	private function makePeriod($date, $type)
+	{
 	    $datearray = getdate($date);
 	    switch($type) {
 	        case 'year':
@@ -154,8 +159,8 @@
 	            $to = strtotime('+1 month', $from);
 	            break;
 	        /**case 'week':
-	            $from = DateUtil::getDatetime("substr ($date, 0, strpos ($date, ' '));
-	            $to = DateUtil::getDatetime("$from +1 year");
+	            $from = DateUtil::getDatetime(substr($date, 0, strpos($date, ' '));
+	            $to = DateUtil::getDatetime($from . ' +1 year');
 	            break;*/
 	        case 'day':
 	        case 'tomorrow':
@@ -176,9 +181,11 @@
 	    return array($from, $to);
 	}
 	
-	public function GetSQL($field, $op, $value) {
-	    if (array_search($op, $this->ops) === false || array_search($field, $this->fields) === false)
+	public function GetSQL($field, $op, $value)
+	{
+	    if (array_search($op, $this->ops) === false || array_search($field, $this->fields) === false) {
 	        return '';
+	    }
 	    $type = 'point';
 	    if (preg_match('~^(year|month|week|day|hour|min):\s*(.*)$~i', $value, $res)) {
 	        $type = strtolower($res[1]);
@@ -204,7 +211,7 @@
 	                list($from, $to) = $this->makePeriod($time, $type);
 	                $where = $this->column[$field].' < \''.DateUtil::getDatetime($from).'\' AND '.$this->column[$field].' >= \''.DateUtil::getDatetime($to).'\'';
 	            } else {
-	                $where = $this->column[$field].' <> \''.DateUtil::getDatetime($time).'\'';
+	                $where = $this->column[$field] . ' != \'' . DateUtil::getDatetime($time) . '\'';
 	            }
 	            break;
 	        case 'gt':
@@ -231,4 +238,4 @@
 	    
 	}
 }
-?>
\ No newline at end of file
+?>
Index: FilterUtil/FilterUtil_Common.class.php
===================================================================
--- FilterUtil/FilterUtil_Common.class.php	(revision 15)
+++ FilterUtil/FilterUtil_Common.class.php	(working copy)
@@ -89,7 +89,7 @@
 	 */
 	protected function setTable($table)
 	{
-		$pntable =& pnDBGetTables();
+		$pntable = pnDBGetTables();
 
 		if (!isset($pntable[$table]) || !isset($pntable[$table . '_column'])) {
 			return false;
@@ -113,7 +113,7 @@
 	 */
 	protected function setJoin(&$join)
 	{
-	    $this->join =& $join;
+        $this->join = $join;
         $this->addJoinToColumn();
 	}
 	
@@ -125,11 +125,11 @@
 	 */
 	protected function addJoinToColumn()
 	{
-	    if (count($this->join) <= 0)
+	    if (count($this->join) < 1) {
 	        return;
 
-	    $pntable =& pnDBGetTables();
-	    $c =& $this->column;
+	    $pntable = pnDBGetTables();
+	    $c = $this->column;
 	    // reset column array...
 	    $c = $pntable[$this->pntable.'_column'];
 	    // now add alias "tbl" to all fields
@@ -140,7 +140,7 @@
 	    // add fields of all joins
 	    $alias = 'a';
 	    foreach ($this->join as &$join) {
-	        $jc =& $pntable[$join['join_table'].'_column'];
+	        $jc = $pntable[$join['join_table'].'_column'];
 	        foreach ($join['join_field'] as $k => $f) {
 	            $a = $join['object_field_name'][$k];
 	            if (isset($c[$a])) {
@@ -182,6 +182,6 @@
 	{
 		$config['table'] = $this->pntable;
 		$config['module'] = $this->module;
-		$config['join'] =& $this->join;
+		$config['join'] = $this->join;
 	}
-}
\ No newline at end of file
+}
Index: FilterUtil/FilterUtil_Plugin.class.php
===================================================================
--- FilterUtil/FilterUtil_Plugin.class.php	(revision 15)
+++ FilterUtil/FilterUtil_Plugin.class.php	(working copy)
@@ -101,7 +101,7 @@
 		$obj = new $class($config);
 
 		$this->plg[] = $obj;
-		$obj =& end($this->plg);
+		$obj = end($this->plg);
 		$obj->setID(key($this->plg));
 		$this->registerPlugin(key($this->plg));
 
@@ -119,7 +119,7 @@
 	 */
 	private function registerPlugin($k)
 	{
-		$obj =& $this->plg[$k];
+		$obj = $this->plg[$k];
 		if ($obj instanceof FilterUtil_Build) {
 			$ops = $obj->getOperators();
 			if (isset($ops) && is_array($ops)) {
@@ -187,7 +187,7 @@
 	public function replace($field, $op, $value)
 	{
 		foreach ($this->replaces as $k) {
-			$obj =& $this->plg[$k];
+			$obj = $this->plg[$k];
 			list($field, $op, $value) = $obj->replace($field, $op, $value);
 		}
 
@@ -218,4 +218,4 @@
 			return '';
 		}
 	}
-}
\ No newline at end of file
+}


--- NEW FILE zikula-module-filterutil.spec ---
%global zikula_base         %{_datadir}/zikula
%global zikula_modname      filterutil

Name:           zikula-module-%{zikula_modname}
Version:        0
Release:        0.2.20090915svn15%{?dist}
Summary:        Pagesetter like filter rules for Zikula
Group:          Applications/Publishing
License:        GPLv2+
URL:            http://code.zikula.org/filterutil
# svn export -r 15 https://code.zikula.org/svn/filterutil/trunk filterutil-0
# tar -cjvf filterutil-0.tar.bz2 filterutil-0
Source0:        filterutil-0.tar.bz2
# Style and bugfix backport from zikula Core 
# https://code.zikula.org/svn/core/development/main/includes/FilterUtil
Patch0:         filterutil-style-bugfix-zikula-trunk.patch
Patch1:         filterutil-separate-module.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
Requires:       zikula

%description
FilterUtil brings Pagesetter like filter rules to Zikula.  This work is a
backport of the module included in zikula 2.0.

%prep
%setup -q -n %{zikula_modname}-%{version}
%patch0 -p0
%patch1 -p1

%build

find . -type 'f' -exec chmod a-x \{\} \;

%install
rm -rf %{buildroot}

mkdir -p %{buildroot}/%{zikula_base}/config/classes/%{zikula_modname}
cp -pr . %{buildroot}/%{zikula_base}/config/classes/%{zikula_modname}
rm -rf %{buildroot}/%{zikula_base}/*.pdf

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc manual-developer.pdf manual-user.pdf
%{zikula_base}/config/classes/%{zikula_modname}


%changelog
* Thu Sep 17 2009 Toshio Kuratomi <toshio at fedoraproject.org> - 0-0.2.20090915svn15
- Add fixes from itbegins for putting this in its own zikula directory

* Tue Sep 15 2009 Toshio Kuratomi <toshio at fedoraproject.org> - 0-0.1.20090915svn15
- Initial package attempt


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/zikula-module-filterutil/EL-5/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	6 Oct 2009 17:35:24 -0000	1.1
+++ .cvsignore	21 Oct 2009 20:04:37 -0000	1.2
@@ -0,0 +1 @@
+filterutil-0.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/zikula-module-filterutil/EL-5/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	6 Oct 2009 17:35:24 -0000	1.1
+++ sources	21 Oct 2009 20:04:37 -0000	1.2
@@ -0,0 +1 @@
+f2023afb84f125fce2c767c9fdf398fd  filterutil-0.tar.bz2




More information about the fedora-extras-commits mailing list