UnlinkArticle() 공개 정적인 메소드

Sets the article's map to be without an article link, to stay as a lone map.
public static UnlinkArticle ( $p_articleObj = null, $p_articleNumber ) : array
리턴 array
예제 #1
0
$f_language_id = Input::Get('f_language_id', 'int', 0);
$f_language_selected = Input::Get('f_language_selected', 'int', 0);
$f_article_number = Input::Get('f_article_number', 'int', 0);

// Check input
if (!Input::IsValid()) {
	camp_html_display_error(getGS('Invalid input: $1', Input::GetErrorString()), null, true);
	exit;
}

// This file can only be accessed if the user has the right to change articles
// or the user created this article and it hasnt been published yet.
if (!$g_user->hasPermission('ChangeArticle')) {
	camp_html_display_error(getGS("You do not have the right to remove maps from articles."), null, true);
	exit;
}

$language_usage = $f_language_selected;
if ((!$language_usage) || (0 == $language_usage))
{
    $language_usage = $f_language_id;
}

$articleObj = new Article($f_language_selected, $f_article_number);
Geo_Map::UnlinkArticle($articleObj);

camp_html_add_msg(getGS('The map has been removed from the article.'), "ok");
camp_html_goto_page(camp_html_article_url($articleObj, $f_language_id, 'edit.php'));
?>
예제 #2
0
파일: GeoMap.php 프로젝트: nidzix/Newscoop
 /**
  * This is called when the (last language of the) article is deleted
  * Remove map pointers to the given article.
  * After article removal (with all its languages), the map is preserved with just the last language.
  *
  * @param int $p_articleNumber
  *
  * @return void
  */
 public static function OnArticleDelete($p_articleNumber)
 {
     Geo_MapLocation::CleanFound();
     return Geo_Map::UnlinkArticle(null, $p_articleNumber);
 }
예제 #3
0
	/**
	 * This is called when the (last language of the) article is deleted
	 * Remove map pointers to the given article.
	 * After article removal (with all its languages), the map is preserved with just the last language.
	 *
	 * @param int $p_articleNumber
	 *
	 * @return void
	 */
	public static function OnArticleDelete($p_articleNumber)
	{
        return Geo_Map::UnlinkArticle(null, $p_articleNumber);
	} // fn OnArticleDelete