/** * Convention Archive Management */ public function archivesAction() { $con = $this->_getConvention(); $folders = ConventionArchive::getFolders(); $this->view->folders = $folders; $types = ConventionArchive::getTypes(); $archives_raw = $con->archives; $archives = array(); if (count($archives_raw) > 0) { foreach ($archives_raw as $row) { $row_arr = $row->toArray(); $row_arr['type_text'] = $types[$row_arr['type']]; if ($row->playlist_id) { $archives[$row->playlist_id]['videos'][] = $row_arr; } else { $row_arr['videos'] = array(); $archives[$row->id] = $row_arr; } } } $archives_by_folder = array(); foreach ($archives as $id => $row) { $archives_by_folder[$row['folder']][$id] = $row; } $this->view->archives = $archives_by_folder; }
<?php $types = \Entity\ConventionArchive::getTypes(); $folders = \Entity\ConventionArchive::getFolders(); return array('method' => 'post', 'enctype' => 'multipart/form-data', 'elements' => array('web_url' => array('text', array('label' => 'Archive Video URL', 'class' => 'half-width', 'required' => true)), 'type' => array('radio', array('label' => 'Type of URL', 'multiOptions' => $types, 'required' => true, 'default' => 'yt_playlist')), 'folder' => array('radio', array('label' => 'Archive Folder', 'multiOptions' => $folders, 'required' => true, 'default' => 'pvl')), 'submit' => array('submit', array('type' => 'submit', 'label' => 'Save Changes', 'helper' => 'formButton', 'class' => 'ui-button'))));