Forums / Cotonti / Extensions / Support / Make news editable on homepage

foxhound
#21141 2009-11-22 23:17
I am trying to edit the news plugin which comes with Cotonti so that there is again the possibility for admins to edit any articles which are displayed on the homepage. So, you do not have to go to the page itself first.
So, at the moment I am editing the news.function.php in the news plugin folder and added this (and a lot of other tries but I think this is the best and I should almost be there):
	// Added to enable editing of pages on homepage
	if ($usr['isadmin'] || $usr['id'] == $pag['page_ownerid'])
	{
	$news-> assign("PAGE_ROW_ADMIN_EDIT", "<a href=\"".sed_url('page', 'm=edit&id='.$pag['page_id'].'&r=list')."\">".$L['Edit'].'</a>');
	}

But, it generates an error:
Fatal error: Call to a member function assign() on a non-object in /home/armaholi/public_html/testers/armaholictest/plugins/news/inc/news.functions.php on line 55

So, after some more tinkering I figured I needed to add this:
	// Added to enable editing of pages on homepage
	list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = sed_auth('page', 'any');
sed_block($usr['auth_read']);

	// Added to enable editing of pages on homepage
	list($usr['auth_read'], $usr['auth_write'], $usr['isadmin'], $usr['auth_download']) = sed_auth('page', $pag['page_cat'], 'RWA1'); 
As it is refering to a member (rights?).
But still no joy, the admin can still not edit the news on the homepage.
Anyone able and willing to tell me what I am doing wrong?
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />