public function getLoop() { $media = Player_Flags::getFlag('playlist', 'media'); if ($this->_loop == null) { $files = Player_Flags::getFlag('files', 'loop'); $label = Player_Flags::getFlag('label', 'loop'); $path = Player_Flags::getFlag('path'); $file = Player_File::getFile($path['config'] . $files['file']); $loop = Player_Convert::getXML($file, $label); $this->_loop = $loop; } foreach ($this->_loop as $key => $value) { $check = 0; foreach ($this->_loop[$key] as $k => $v) { if ($this->_loop[$key][$k][$media['status']] == false) { $check++; } } if ($check == count($value)) { foreach ($this->_loop[$key] as $k => $v) { $this->_loop[$key][$k][$media['status']] = true; } } } return $this->_loop; }
/** * Run installation. * * @return string */ private function __runInstall($connection, $validate, $params = null) { $url = Player_Flags::getFlag('url'); $status = Player_Flags::getFlag('status'); $player = Player_Flags::getFlag('player'); $label = Player_Flags::getFlag('label'); $login = $connection->loadConnection($this->getEnvironment(), $url['login'], $params); if ($login) { $xml = Player_Convert::getXML($login, $label['config']); if (isset($xml[$status['active']])) { if (intval($xml[$status['active']]) == 1) { Player_File::setFile($this->getConfigFile(), $login, true); return true; } } } return false; }
public function setDownload() { Player_Debug::setDebug('Saving settings...'); Player_Debug::setStatus('Finishing download...'); $path = Player_Flags::getFlag('path'); $files = Player_Flags::getFlag('files'); $label = Player_Flags::getFlag('label'); $status = Player_Flags::getFlag('status'); $file = Player_File::getFile($path['config'] . $files['config']['file']); $xml = Player_Convert::getXML($file, $label['config']); $xml[$status['download']] = 1; $file = Player_Convert::setXML($label['config'], $xml); if (Player_File::setFile($path['config'] . $files['config']['file'], $file, true)) { if (file_exists($path['config'] . $files['download']['file'])) { if (Player_File::unsetFile($path['config'] . $files['download']['file'])) { return true; } else { return false; } } return true; } return false; }