* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio
* @copyright Copyright (c) 2012, Ernest Marcinko
*/
class wpdreamsBlogselect extends wpdreamsType {
private $useall = "";
private $blogs, $selected;
function getType() {
parent::getType();
$this->processData();
if ( function_exists( 'get_sites' ) ) {
$this->blogs = get_sites(array('number' => 1000));
} else {
$this->blogs = array();
}
echo "
";
}
function processData() {
$this->data = str_replace("\n", "", $this->data);
$this->selected = null;
if (!empty($this->data)) {
// Check for the use-all checkbox
$tmp = explode( "xxx", $this->data );
if (isset($tmp[1]))
$this->useall = "checked='checked'";
// Get the selected IDs
if ($tmp[0] != "")
$this->selected = explode( "|", $tmp[0] );
} else {
$this->useall = "";
}
}
final function getData() {
return $this->data;
}
final function getSelected() {
if ($this->useall != '')
return "all";
return $this->selected;
}
}
}