# R36018 - /trunk/news\_admin/inc/class.uinews.inc.php

**URL:** <http://discourse.egroupware.org/t/r36018-trunk-news-admin-inc-class-uinews-inc-php/48660>\
**Category:** eGW-svn\
**Created:** [August 5, 2011, 8:12pm UTC](http://discourse.egroupware.org/t/r36018-trunk-news-admin-inc-class-uinews-inc-php/48660 "2011-08-05T20:12:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathangray](http://discourse.egroupware.org/letter_avatar_proxy/v4/letter/n/77aa72/32.png) [@nathangray](http://discourse.egroupware.org/u/nathangray)\
**Post date:** [August 5, 2011, 8:12pm UTC](http://discourse.egroupware.org/t/r36018-trunk-news-admin-inc-class-uinews-inc-php/48660/1 "2011-08-05T20:12:02Z")

</div>

Author: nathangray  
New Revision: 36018

URL: [http://svn.stylite.de/viewvc/egroupware?rev=36018&view=rev](http://svn.stylite.de/viewvc/egroupware?rev=36018&view=rev)  
Log:  
Fix Edit & Delete buttons in view

Modified:  
trunk/news\_admin/inc/class.uinews.inc.php

# Modified: trunk/news\_admin/inc/class.uinews.inc.php URL: [http://svn.stylite.de/viewvc/egroupware/trunk/news\_admin/inc/class.uinews.inc.php?rev=36018&r1=36017&r2=36018&view=diff](http://svn.stylite.de/viewvc/egroupware/trunk/news_admin/inc/class.uinews.inc.php?rev=36018&r1=36017&r2=36018&view=diff)

— trunk/news\_admin/inc/class.uinews.inc.php (original)  
+++ trunk/news\_admin/inc/class.uinews.inc.php Fri Aug 5 22:12:01 2011  
@@ -52,11 +52,22 @@  
public function view($content = array())  
{  
$news\_id = $content[‘news\_id’] ? $content[‘news\_id’] : $\_GET[‘news\_id’];

- 

```
  if(!$this->read($_GET['news_id']))

```

- 

```
  {

```

- 

```
  }

```

- 
- 

```
  $content = $this->data;

```

- 

```
  if(!$this->read($news_id))

```

- 

```
  {

```

- 

```
  }

```

- 
- 

```
  $content = array_merge($this->data, $content);

```

- 

```
  if($content['edit'])

```

- 

```
  {

```

- 

```
  	return $this->edit($content);

```

- 

```
  }

```

- 

```
  elseif ($content['delete'] && $this->check_acl(EGW_ACL_DELETE))

```

- 

```
  {

```

- 

```
  	$this->delete(array('news_id' => $this->data['news_id']));

```

- 

```
  	$msg = lang('News deleted.');

```

- 

```
  	echo "<html><body><script>var referer = '".($link=$GLOBALS['egw']->link($referer,array('msg' => $msg)))."'; window.close();</script></body></html>\n";

```

- 

```
  	$GLOBALS['egw']->common->egw_exit();

```

- 

```
  }
  $sel_options = array(
  	'cat_id' => $this->rights2cats($this->data['news_id'] ? EGW_ACL_EDIT : EGW_ACL_ADD),
  	'visible' => $this->visiblity,

```

@@ -65,6 +76,7 @@  
$readonlys[‘edit’] = !$this-\>check\_acl(EGW\_ACL\_EDIT);  
$readonlys[‘delete’] = !$this-\>check\_acl(EGW\_ACL\_DELETE);

- 

```
  $preserve['news_id'] = $news_id;
  egw_framework::set_onload('$j(document).ready(popup_resize);');
  $this->tpl->read('news_admin.view');
  return $this->tpl->exec('news_admin.uinews.view',$content,$sel_options,$readonlys,$preserve,2);

```

* * *

BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA  
The must-attend event for mobile developers. Connect with experts.  
Get tools for creating Super Apps. See the latest technologies.  
Sessions, hands-on labs, demos & much more. Register early & save!  
[http://p.sf.net/sfu/rim-blackberry-1](http://p.sf.net/sfu/rim-blackberry-1)

* * *

eGroupWare-cvs mailing list  
[eGroupWare-cvs@lists.sourceforge.net](mailto:eGroupWare-cvs@lists.sourceforge.net)  
[https://lists.sourceforge.net/lists/listinfo/egroupware-cvs](https://lists.sourceforge.net/lists/listinfo/egroupware-cvs)
