<?php

/**
 * Snippet to place in the page head to specify the Facebook admins for the page.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @package clearFusionCMS\module\social
 * @copyright Copyright (c) 2012 - 2016 clearFusionCMS. All rights reserved.
 * @link http://clearfusioncms.com
 * @see https://developers.facebook.com/docs/reference/plugins/comments/
 */

/** @var $tplEngine cfTemplateEngine */

// admins is a comma separated of the facebook IDs of the page admins
if(isset($admins)) {
	$admins = preg_split('/\s*,\s*/', $admins);
}
else {
	$cfg = clearFusionCMS::getSiteConfig('cfSocial');
	$admins = preg_split('/\s*,\s*/', $cfg->get('fbAdmins', ''));
}

foreach($admins as $admin) {
	$admin = trim($admin);
	if(!empty($admin))
		echo "<meta property=\"fb:admins\" content=\"$admin\" />\n";
}
