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; }
/** * Gets the player activation code from the .activation filename. * * @return string */ public function getActivation() { if ($this->_activation == null) { if (file_exists($this->_filename)) { $activation = Player_File::getFile($this->_filename); $this->_activation = $activation; } else { return $this->setActivation(); } } return $this->_activation; }
public function showLayout($layout = null, $options = null) { if ($options != null) { $this->customLayout($options); } $filename = $this->getLayout($layout); $file = Player_File::getFile($filename); ob_start(); include $filename; $return = ob_get_contents(); ob_end_clean(); print $return; }
/** * Sets the settings from .ini file. * * @param array $configs null * @return array */ public function setConfig() { $filename = $this->getConfigFile(); $label = Player_Flags::getFlag('label'); if ($filename != null) { if (file_exists($filename)) { $file = Player_File::getFile($filename); $this->_config = Player_Convert::getXML($file, $label['config']); } } }
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; }