public function __construct($name = null, array $data = [], $dataName = '') { parent::__construct($name, $data, $dataName); $this->container = createContainer(); $this->container->set('config', $this->createConfig()); Model::setFactory($this->container); }
return '<div class="column"><div class="ui raised segment"><a class="ui ' . $container['color'] . ' ribbon label">' . $container['nome'] . '</a> <div class="ui selection list">' . $container['itens'] . '<div class="ui divider"></div>' . $container['itensNull'] . '</div></div></div>'; } // Cria o container com os itens separados por tipo $arrContainer = null; foreach ($tipo->loadTipos() as $itemTipo) { $arrItem = null; $arrItemNull = null; foreach ($listOrd as $item) { if ($item['tipo'] == strtolower($itemTipo['type']) && $item['qtd'] != '0') { $arrItem .= createItem($listKey, array('nome' => $item['item'], 'qtd' => $item['qtd'], 'tipo' => $itemTipo['type'], 'pessoas' => $item['pessoas'])); } elseif ($item['tipo'] == strtolower($itemTipo['type']) && $item['qtd'] == '0') { $arrItemNull .= createItem($listKey, array('nome' => $item['item'], 'tipo' => $itemTipo['type'])); } } $arrContainer .= createContainer(array('color' => 'red', 'nome' => $itemTipo['nome'], 'itens' => $arrItem, 'itensNull' => $arrItemNull)); } } ?> <div class="ui grid"> <div class="four wide column"> <div class="header">Listas</div> <div class="ui secondary vertical pointing menu"> <?php foreach (array_reverse($script->getList()) as $value) { $active = ''; if (isset($_GET['list']) && $_GET['list'] == $value['Data']) { $active = 'active'; } echo '<a class="item ' . $active . '" href="?list=' . $value['Data'] . '">' . $value['Data'] . '</a>';
/** * Export XML data * * @param string $where WHERE clause for SQL statement */ function xmlexport($WHERE) { global $config; // get data $result = exportData($WHERE); // do adultcheck if (is_array($result)) { $result = array_filter($result, create_function('$video', 'return adultcheck($video["id"]);')); } $xml = ''; // loop over items foreach ($result as $item) { $xml_item = ''; // loop over attributes foreach ($item as $key => $value) { if (!empty($value)) { if ($key != 'owner_id' && $key != 'actors') { $tag = strtolower($key); $xml_item .= createTag($tag, trim(html_entity_decode_all($value))); } } } // this is a hack for exporting thumbnail URLs if ($item['imgurl'] && $config['xml_thumbnails']) { $thumb = getThumbnail($item['imgurl']); if (preg_match('/cache/', $thumb)) { $xml_item .= createTag('thumbnail', trim($thumb)); } } // genres if (count($row['genres'])) { $xml_genres = ''; foreach ($row['genres'] as $genre) { $xml_genres .= createTag('genre', $genre['name']); } $xml_item .= createContainer('genres', $xml_genres); } // actors $actors = explode("\n", $item['actors']); if (count($actors)) { $xml_actors = ''; foreach ($actors as $actor) { $xml_actor_data = ''; $actor_data = explode("::", $actor); $xml_actor_data .= createTag('name', $actor_data[0]); $xml_actor_data .= createTag('role', $actor_data[1]); $xml_actor_data .= createTag('imdbid', $actor_data[2]); $xml_actors .= createContainer('actor', $xml_actor_data); } $xml_item .= createContainer('actors', $xml_actors); } $xml .= createContainer('item', $xml_item); } $xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n" . createContainer('catalog', $xml); // header('Content-type: text/xml'); $mime = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/force-download' : 'application/octet-stream'; header('Content-type: ' . $mime); header('Content-length: ' . strlen($xml)); header('Content-disposition: attachment; filename=videoDB.xml'); echo $xml; }