feat(podcast): create a podcast using form

This commit is contained in:
Yassine Doghri 2020-05-31 19:15:52 +00:00
parent 9daa0df006
commit 1202ba3545
18 changed files with 1107 additions and 130 deletions

View File

@ -97,6 +97,7 @@ Populate the database with the required data:
```bash
# Populates all categories
docker-compose run --rm app php spark db:seed CategorySeeder
docker-compose run --rm app php spark db:seed LanguageSeeder
```
### Start hacking

View File

@ -0,0 +1,71 @@
<?php namespace App\Controllers;
use App\Models\CategoryModel;
use App\Models\LanguageModel;
use App\Models\PodcastModel;
use RuntimeException;
class Podcast extends BaseController
{
public function index()
{
return view('podcast/index.php');
}
public function create()
{
$model = new PodcastModel();
if (!$this->validate([
'title' => 'required',
'name' => 'required|alpha_dash',
'description' => 'required|max_length[4000]',
'image' => 'uploaded[image]|is_image[image]|ext_in[image,jpg,png]|max_dims[image,3000,3000]',
'owner_email' => 'required|valid_email|permit_empty',
'type' => 'required',
])) {
$langs = explode(',', $this->request->getServer('HTTP_ACCEPT_LANGUAGE'));
$browser_lang = '';
if (!empty($langs)) {
$browser_lang = substr($langs[0], 0, 2);
}
$languageModel = new LanguageModel();
$categoryModel = new CategoryModel();
$data = [
'languages' => $languageModel->findAll(),
'categories' => $categoryModel->findAll(),
'browser_lang' => $browser_lang,
];
echo view('podcast/create', $data);
} else {
$image = $this->request->getFile('image');
if (!$image->isValid()) {
throw new RuntimeException($image->getErrorString() . '(' . $image->getError() . ')');
}
$image_path = $image->store();
$model->save([
'title' => $this->request->getVar('title'),
'name' => $this->request->getVar('name'),
'description' => $this->request->getVar('description'),
'episode_description_footer' => $this->request->getVar('episode_description_footer'),
'image' => $image_path,
'language' => $this->request->getVar('language'),
'category' => $this->request->getVar('category'),
'explicit' => $this->request->getVar('explicit') or false,
'author' => $this->request->getVar('author'),
'owner_name' => $this->request->getVar('owner_name'),
'owner_email' => $this->request->getVar('owner_email'),
'type' => $this->request->getVar('type'),
'copyright' => $this->request->getVar('copyright'),
'block' => $this->request->getVar('block') or false,
'complete' => $this->request->getVar('complete') or false,
'custom_html_head' => $this->request->getVar('custom_html_head'),
]);
echo view('podcast/success');
}
}
}

View File

@ -10,26 +10,30 @@ class AddCategories extends Migration
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 10,
'unsigned' => TRUE,
'id' => [
'type' => 'INT',
'constraint' => 10,
'unsigned' => true,
],
'parent_id' => [
'type' => 'INT',
'constraint' => 10,
'unsigned' => TRUE
'parent_id' => [
'type' => 'INT',
'constraint' => 10,
'unsigned' => true,
],
'apple_category' => [
'type' => 'VARCHAR',
'constraint' => '1024',
'code' => [
'type' => 'VARCHAR',
'constraint' => 1024,
],
'apple_category' => [
'type' => 'VARCHAR',
'constraint' => 1024,
],
'google_category' => [
'type' => 'VARCHAR',
'constraint' => '1024',
'type' => 'VARCHAR',
'constraint' => 1024,
],
]);
$this->forge->addKey('id', TRUE);
$this->forge->addKey('id', true);
$this->forge->addForeignKey('parent_id', 'categories', 'id');
$this->forge->createTable('categories');
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Database\Migrations;
use \CodeIgniter\Database\Migration;
class AddLanguages extends Migration
{
public function up()
{
$this->forge->addField([
'code' => [
'type' => 'VARCHAR',
'constraint' => 2,
],
]);
$this->forge->addKey('code', true);
$this->forge->createTable('languages');
}
public function down()
{
$this->forge->dropTable('languages');
}
}

View File

@ -0,0 +1,124 @@
<?php
namespace App\Database\Migrations;
use \CodeIgniter\Database\Migration;
class AddPodcasts extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'BIGINT',
'constraint' => 20,
'unsigned' => true,
'auto_increment' => true,
'comment' => 'The podcast ID',
],
'title' => [
'type' => 'VARCHAR',
'constraint' => 1024,
'comment' => 'The show title. Its important to have a clear, concise name for your podcast. Make your title specific. A show titled Our Community Bulletin is too vague to attract many subscribers, no matter how compelling the content. Pay close attention to the title as Apple Podcasts uses this field for search. If you include a long list of keywords in an attempt to game podcast search, your show may be removed from the Apple directory.',
],
'name' => [
'type' => 'VARCHAR',
'constraint' => 191,
'unique' => true,
'comment' => 'Unique podcast string identifier.',
],
'description' => [
'type' => 'TEXT',
'null' => true,
'comment' => 'The show description. Where description is text containing one or more sentences describing your podcast to potential listeners. The maximum amount of text allowed for this tag is 4000 characters. To include links in your description or rich HTML, adhere to the following technical guidelines: enclose all portions of your XML that contain embedded HTML in a CDATA section to prevent formatting issues, and to ensure proper link functionality.',
'null' => true,
],
'episode_description_footer' => [
'type' => 'TEXT',
'null' => true,
],
'image' => [
'type' => 'VARCHAR',
'constraint' => 1024,
'comment' => 'The artwork for the show. Specify your show artwork by providing a URL linking to it. Depending on their device, subscribers see your podcast artwork in varying sizes. Therefore, make sure your design is effective at both its original size and at thumbnail size. You should include a show title, brand, or source name as part of your podcast artwork. Artwork must be a minimum size of 1400 x 1400 pixels and a maximum size of 3000 x 3000 pixels, in JPEG or PNG format, 72 dpi, with appropriate file extensions (.jpg, .png), and in the RGB colorspace.',
],
'language' => [
'type' => 'VARCHAR',
'constraint' => 2,
'comment' => 'The language spoken on the show. Because Apple Podcasts is available in territories around the world, it is critical to specify the language of a podcast. Apple Podcasts only supports values from the ISO 639 list (two-letter language codes, with some possible modifiers, such as "en-us"). Invalid language codes will cause your feed to fail Apple validation.',
],
'category' => [
'type' => 'VARCHAR',
'constraint' => 1024,
'comment' => 'The show category information. For a complete list of categories and subcategories, see Apple Podcasts categories. Select the category that best reflects the content of your show. If available, you can also define a subcategory. Although you can specify more than one category and subcategory in your RSS feed, Apple Podcasts only recognizes the first category and subcategory. When specifying categories and subcategories, be sure to properly escape ampersands.',
'null' => true,
],
'explicit' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
'comment' => 'The podcast parental advisory information. The explicit value can be one of the following: True: If you specify true, indicating the presence of explicit content, Apple Podcasts displays an Explicit parental advisory graphic for your podcast. Podcasts containing explicit material arent available in some Apple Podcasts territories. False: If you specify false, indicating that your podcast doesnt contain explicit language or adult content, Apple Podcasts displays a Clean parental advisory graphic for your podcast.',
],
'author' => [
'type' => 'VARCHAR',
'constraint' => 1024,
'comment' => 'The group responsible for creating the show. Show author most often refers to the parent company or network of a podcast, but it can also be used to identify the host(s) if none exists. Author information is especially useful if a company or organization publishes multiple podcasts. Providing this information will allow listeners to see all shows created by the same entity.',
'null' => true,
],
'owner_name' => [
'type' => 'VARCHAR',
'constraint' => 1024,
'owner_name' => 'The podcast owner name. Note: The owner information is for administrative communication about the podcast and isnt displayed in Apple Podcasts.',
'null' => true,
],
'owner_email' => [
'type' => 'VARCHAR',
'constraint' => 1024,
'owner_email' => 'The podcast owner email address. Note: The owner information is for administrative communication about the podcast and isnt displayed in Apple Podcasts. Please make sure the email address is active and monitored.',
'null' => true,
],
'type' => [
'type' => 'ENUM',
'constraint' => ['episodic', 'serial'],
'default' => 'episodic',
'comment' => 'The type of show. If your show is Serial you must use this tag. Its values can be one of the following: episodic (default). Specify episodic when episodes are intended to be consumed without any specific order. Apple Podcasts will present newest episodes first and display the publish date (required) of each episode. If organized into seasons, the newest season will be presented first - otherwise, episodes will be grouped by year published, newest first. For new subscribers, Apple Podcasts adds the newest, most recent episode in their Library. serial. Specify serial when episodes are intended to be consumed in sequential order. Apple Podcasts will present the oldest episodes first and display the episode numbers (required) of each episode. If organized into seasons, the newest season will be presented first and <itunes:episode> numbers must be given for each episode. For new subscribers, Apple Podcasts adds the first episode to their Library, or the entire current season if using seasons',
],
'copyright' => [
'type' => 'VARCHAR',
'constraint' => 1024,
'comment' => 'The show copyright details. If your show is copyrighted you should use this tag.',
'null' => true,
],
'block' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
'comment' => 'The podcast show or hide status. If you want your show removed from the Apple directory, use this tag. Specifying the <itunes:block> tag with a Yes value, prevents the entire podcast from appearing in Apple Podcasts. Specifying any value other than Yes has no effect.',
],
'complete' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
'comment' => 'The podcast update status. If you will never publish another episode to your show, use this tag. Specifying the <itunes:complete> tag with a Yes value indicates that a podcast is complete and you will not post any more episodes in the future. Specifying any value other than Yes has no effect.',
],
'custom_html_head' => [
'type' => 'TEXT',
'null' => true,
],
'created_at' => [
'type' => 'TIMESTAMP',
],
'updated_at' => [
'type' => 'TIMESTAMP',
],
]);
$this->forge->addKey('id', true);
$this->forge->createTable('podcasts');
}
public function down()
{
$this->forge->dropTable('podcasts');
}
}

View File

@ -4,123 +4,122 @@ namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class CategorySeeder extends Seeder
{
public function run()
{
$data = array(
array('parent_id' => 0, 'id' => 0, 'apple_category' => 'uncategorized', 'google_category' => 'uncategorized'),
array('parent_id' => 0, 'id' => 1, 'apple_category' => 'Arts', 'google_category' => 'Arts'),
array('parent_id' => 0, 'id' => 2, 'apple_category' => 'Business', 'google_category' => 'Business'),
array('parent_id' => 0, 'id' => 3, 'apple_category' => 'Comedy', 'google_category' => 'Comedy'),
array('parent_id' => 0, 'id' => 4, 'apple_category' => 'Education', 'google_category' => 'Education'),
array('parent_id' => 0, 'id' => 5, 'apple_category' => 'Fiction', 'google_category' => ''),
array('parent_id' => 0, 'id' => 6, 'apple_category' => 'Government', 'google_category' => 'Government &amp; Organizations'),
array('parent_id' => 0, 'id' => 7, 'apple_category' => 'Health &amp; Fitness', 'google_category' => 'Health'),
array('parent_id' => 0, 'id' => 8, 'apple_category' => 'History', 'google_category' => ''),
array('parent_id' => 0, 'id' => 9, 'apple_category' => 'Kids &amp; Family', 'google_category' => 'Kids &amp; Family'),
array('parent_id' => 0, 'id' => 10, 'apple_category' => 'Leisure', 'google_category' => 'Games &amp; Hobbies'),
array('parent_id' => 0, 'id' => 11, 'apple_category' => 'Music', 'google_category' => 'Music'),
array('parent_id' => 0, 'id' => 12, 'apple_category' => 'News', 'google_category' => 'News &amp; Politics'),
array('parent_id' => 0, 'id' => 13, 'apple_category' => 'Religion &amp; Spirituality', 'google_category' => 'Religion &amp; Spirituality'),
array('parent_id' => 0, 'id' => 14, 'apple_category' => 'Science', 'google_category' => 'Science &amp; Medicine'),
array('parent_id' => 0, 'id' => 15, 'apple_category' => 'Society &amp; Culture', 'google_category' => 'Society &amp; Culture'),
array('parent_id' => 0, 'id' => 16, 'apple_category' => 'Sports', 'google_category' => 'Sports &amp; Recreation'),
array('parent_id' => 0, 'id' => 17, 'apple_category' => 'Technology', 'google_category' => 'Technology'),
array('parent_id' => 0, 'id' => 18, 'apple_category' => 'True Crime', 'google_category' => ''),
array('parent_id' => 0, 'id' => 19, 'apple_category' => 'TV &amp; Film', 'google_category' => 'TV &amp; Film'),
array('parent_id' => 1, 'id' => 20, 'apple_category' => 'Books', 'google_category' => ''),
array('parent_id' => 1, 'id' => 21, 'apple_category' => 'Design', 'google_category' => ''),
array('parent_id' => 1, 'id' => 22, 'apple_category' => 'Fashion &amp; Beauty', 'google_category' => ''),
array('parent_id' => 1, 'id' => 23, 'apple_category' => 'Food', 'google_category' => ''),
array('parent_id' => 1, 'id' => 24, 'apple_category' => 'Performing Arts', 'google_category' => ''),
array('parent_id' => 1, 'id' => 25, 'apple_category' => 'Visual Arts', 'google_category' => ''),
array('parent_id' => 2, 'id' => 26, 'apple_category' => 'Careers', 'google_category' => ''),
array('parent_id' => 2, 'id' => 27, 'apple_category' => 'Entrepreneurship', 'google_category' => ''),
array('parent_id' => 2, 'id' => 28, 'apple_category' => 'Investing', 'google_category' => ''),
array('parent_id' => 2, 'id' => 29, 'apple_category' => 'Management', 'google_category' => ''),
array('parent_id' => 2, 'id' => 30, 'apple_category' => 'Marketing', 'google_category' => ''),
array('parent_id' => 2, 'id' => 31, 'apple_category' => 'Non-Profit', 'google_category' => ''),
array('parent_id' => 3, 'id' => 32, 'apple_category' => 'Comedy Interviews', 'google_category' => ''),
array('parent_id' => 3, 'id' => 33, 'apple_category' => 'Improv', 'google_category' => ''),
array('parent_id' => 3, 'id' => 34, 'apple_category' => 'Stand-Up', 'google_category' => ''),
array('parent_id' => 4, 'id' => 35, 'apple_category' => 'Courses', 'google_category' => ''),
array('parent_id' => 4, 'id' => 36, 'apple_category' => 'How To', 'google_category' => ''),
array('parent_id' => 4, 'id' => 37, 'apple_category' => 'Language Learning', 'google_category' => ''),
array('parent_id' => 4, 'id' => 38, 'apple_category' => 'Self-Improvement', 'google_category' => ''),
array('parent_id' => 5, 'id' => 39, 'apple_category' => 'Comedy Fiction', 'google_category' => ''),
array('parent_id' => 5, 'id' => 40, 'apple_category' => 'Drama', 'google_category' => ''),
array('parent_id' => 5, 'id' => 41, 'apple_category' => 'Science Fiction', 'google_category' => ''),
array('parent_id' => 7, 'id' => 42, 'apple_category' => 'Alternative Health', 'google_category' => ''),
array('parent_id' => 7, 'id' => 43, 'apple_category' => 'Fitness', 'google_category' => ''),
array('parent_id' => 7, 'id' => 44, 'apple_category' => 'Medicine', 'google_category' => ''),
array('parent_id' => 7, 'id' => 45, 'apple_category' => 'Mental Health', 'google_category' => ''),
array('parent_id' => 7, 'id' => 46, 'apple_category' => 'Nutrition', 'google_category' => ''),
array('parent_id' => 7, 'id' => 47, 'apple_category' => 'Sexuality', 'google_category' => ''),
array('parent_id' => 9, 'id' => 48, 'apple_category' => 'Education for Kids', 'google_category' => ''),
array('parent_id' => 9, 'id' => 49, 'apple_category' => 'Parenting', 'google_category' => ''),
array('parent_id' => 9, 'id' => 50, 'apple_category' => 'Pets &amp; Animals', 'google_category' => ''),
array('parent_id' => 9, 'id' => 51, 'apple_category' => 'Stories for Kids', 'google_category' => ''),
array('parent_id' => 10, 'id' => 52, 'apple_category' => 'Animation &amp; Manga', 'google_category' => ''),
array('parent_id' => 10, 'id' => 53, 'apple_category' => 'Automotive', 'google_category' => ''),
array('parent_id' => 10, 'id' => 54, 'apple_category' => 'Aviation', 'google_category' => ''),
array('parent_id' => 10, 'id' => 55, 'apple_category' => 'Crafts', 'google_category' => ''),
array('parent_id' => 10, 'id' => 56, 'apple_category' => 'Games', 'google_category' => ''),
array('parent_id' => 10, 'id' => 57, 'apple_category' => 'Hobbies', 'google_category' => ''),
array('parent_id' => 10, 'id' => 58, 'apple_category' => 'Home &amp; Garden', 'google_category' => ''),
array('parent_id' => 10, 'id' => 59, 'apple_category' => 'Video Games', 'google_category' => ''),
array('parent_id' => 11, 'id' => 60, 'apple_category' => 'Music Commentary', 'google_category' => ''),
array('parent_id' => 11, 'id' => 61, 'apple_category' => 'Music History', 'google_category' => ''),
array('parent_id' => 11, 'id' => 62, 'apple_category' => 'Music Interviews', 'google_category' => ''),
array('parent_id' => 12, 'id' => 63, 'apple_category' => 'Business News', 'google_category' => ''),
array('parent_id' => 12, 'id' => 64, 'apple_category' => 'Daily News', 'google_category' => ''),
array('parent_id' => 12, 'id' => 65, 'apple_category' => 'Entertainment News', 'google_category' => ''),
array('parent_id' => 12, 'id' => 66, 'apple_category' => 'News Commentary', 'google_category' => ''),
array('parent_id' => 12, 'id' => 67, 'apple_category' => 'Politics', 'google_category' => ''),
array('parent_id' => 12, 'id' => 68, 'apple_category' => 'Sports News', 'google_category' => ''),
array('parent_id' => 12, 'id' => 69, 'apple_category' => 'Tech News', 'google_category' => ''),
array('parent_id' => 13, 'id' => 70, 'apple_category' => 'Buddhism', 'google_category' => ''),
array('parent_id' => 13, 'id' => 71, 'apple_category' => 'Christianity', 'google_category' => ''),
array('parent_id' => 13, 'id' => 72, 'apple_category' => 'Hinduism', 'google_category' => ''),
array('parent_id' => 13, 'id' => 73, 'apple_category' => 'Islam', 'google_category' => ''),
array('parent_id' => 13, 'id' => 74, 'apple_category' => 'Judaism', 'google_category' => ''),
array('parent_id' => 13, 'id' => 75, 'apple_category' => 'Religion', 'google_category' => ''),
array('parent_id' => 13, 'id' => 76, 'apple_category' => 'Spirituality', 'google_category' => ''),
array('parent_id' => 14, 'id' => 77, 'apple_category' => 'Astronomy', 'google_category' => ''),
array('parent_id' => 14, 'id' => 78, 'apple_category' => 'Chemistry', 'google_category' => ''),
array('parent_id' => 14, 'id' => 79, 'apple_category' => 'Earth Sciences', 'google_category' => ''),
array('parent_id' => 14, 'id' => 80, 'apple_category' => 'Life Sciences', 'google_category' => ''),
array('parent_id' => 14, 'id' => 81, 'apple_category' => 'Mathematics', 'google_category' => ''),
array('parent_id' => 14, 'id' => 82, 'apple_category' => 'Natural Sciences', 'google_category' => ''),
array('parent_id' => 14, 'id' => 83, 'apple_category' => 'Nature', 'google_category' => ''),
array('parent_id' => 14, 'id' => 84, 'apple_category' => 'Physics', 'google_category' => ''),
array('parent_id' => 14, 'id' => 85, 'apple_category' => 'Social Sciences', 'google_category' => ''),
array('parent_id' => 15, 'id' => 86, 'apple_category' => 'Documentary', 'google_category' => ''),
array('parent_id' => 15, 'id' => 87, 'apple_category' => 'Personal Journals', 'google_category' => ''),
array('parent_id' => 15, 'id' => 88, 'apple_category' => 'Philosophy', 'google_category' => ''),
array('parent_id' => 15, 'id' => 89, 'apple_category' => 'Places &amp; Travel', 'google_category' => ''),
array('parent_id' => 15, 'id' => 90, 'apple_category' => 'Relationships', 'google_category' => ''),
array('parent_id' => 16, 'id' => 91, 'apple_category' => 'Baseball', 'google_category' => ''),
array('parent_id' => 16, 'id' => 92, 'apple_category' => 'Basketball', 'google_category' => ''),
array('parent_id' => 16, 'id' => 93, 'apple_category' => 'Cricket', 'google_category' => ''),
array('parent_id' => 16, 'id' => 94, 'apple_category' => 'Fantasy Sports', 'google_category' => ''),
array('parent_id' => 16, 'id' => 95, 'apple_category' => 'Football', 'google_category' => ''),
array('parent_id' => 16, 'id' => 96, 'apple_category' => 'Golf', 'google_category' => ''),
array('parent_id' => 16, 'id' => 97, 'apple_category' => 'Hockey', 'google_category' => ''),
array('parent_id' => 16, 'id' => 98, 'apple_category' => 'Rugby', 'google_category' => ''),
array('parent_id' => 16, 'id' => 99, 'apple_category' => 'Running', 'google_category' => ''),
array('parent_id' => 16, 'id' => 100, 'apple_category' => 'Soccer', 'google_category' => ''),
array('parent_id' => 16, 'id' => 101, 'apple_category' => 'Swimming', 'google_category' => ''),
array('parent_id' => 16, 'id' => 102, 'apple_category' => 'Tennis', 'google_category' => ''),
array('parent_id' => 16, 'id' => 103, 'apple_category' => 'Volleyball', 'google_category' => ''),
array('parent_id' => 16, 'id' => 104, 'apple_category' => 'Wilderness', 'google_category' => ''),
array('parent_id' => 16, 'id' => 105, 'apple_category' => 'Wrestling', 'google_category' => ''),
array('parent_id' => 19, 'id' => 106, 'apple_category' => 'After Shows', 'google_category' => ''),
array('parent_id' => 19, 'id' => 107, 'apple_category' => 'Film History', 'google_category' => ''),
array('parent_id' => 19, 'id' => 108, 'apple_category' => 'Film Interviews', 'google_category' => ''),
array('parent_id' => 19, 'id' => 109, 'apple_category' => 'Film Reviews', 'google_category' => ''),
array('parent_id' => 19, 'id' => 110, 'apple_category' => 'TV Reviews', 'google_category' => ''),
array('parent_id' => 0, 'id' => 0, 'code' => 'uncategorized', 'apple_category' => 'uncategorized', 'google_category' => 'uncategorized'),
array('parent_id' => 0, 'id' => 1, 'code' => 'arts', 'apple_category' => 'Arts', 'google_category' => 'Arts'),
array('parent_id' => 0, 'id' => 2, 'code' => 'business', 'apple_category' => 'Business', 'google_category' => 'Business'),
array('parent_id' => 0, 'id' => 3, 'code' => 'comedy', 'apple_category' => 'Comedy', 'google_category' => 'Comedy'),
array('parent_id' => 0, 'id' => 4, 'code' => 'education', 'apple_category' => 'Education', 'google_category' => 'Education'),
array('parent_id' => 0, 'id' => 5, 'code' => 'fiction', 'apple_category' => 'Fiction', 'google_category' => ''),
array('parent_id' => 0, 'id' => 6, 'code' => 'government', 'apple_category' => 'Government', 'google_category' => 'Government &amp; Organizations'),
array('parent_id' => 0, 'id' => 7, 'code' => 'health_and_fitness', 'apple_category' => 'Health &amp; Fitness', 'google_category' => 'Health'),
array('parent_id' => 0, 'id' => 8, 'code' => 'history', 'apple_category' => 'History', 'google_category' => ''),
array('parent_id' => 0, 'id' => 9, 'code' => 'kids_and_family', 'apple_category' => 'Kids &amp; Family', 'google_category' => 'Kids &amp; Family'),
array('parent_id' => 0, 'id' => 10, 'code' => 'leisure', 'apple_category' => 'Leisure', 'google_category' => 'Games &amp; Hobbies'),
array('parent_id' => 0, 'id' => 11, 'code' => 'music', 'apple_category' => 'Music', 'google_category' => 'Music'),
array('parent_id' => 0, 'id' => 12, 'code' => 'news', 'apple_category' => 'News', 'google_category' => 'News &amp; Politics'),
array('parent_id' => 0, 'id' => 13, 'code' => 'religion_and_spirituality', 'apple_category' => 'Religion &amp; Spirituality', 'google_category' => 'Religion &amp; Spirituality'),
array('parent_id' => 0, 'id' => 14, 'code' => 'science', 'apple_category' => 'Science', 'google_category' => 'Science &amp; Medicine'),
array('parent_id' => 0, 'id' => 15, 'code' => 'society_and_culture', 'apple_category' => 'Society &amp; Culture', 'google_category' => 'Society &amp; Culture'),
array('parent_id' => 0, 'id' => 16, 'code' => 'sports', 'apple_category' => 'Sports', 'google_category' => 'Sports &amp; Recreation'),
array('parent_id' => 0, 'id' => 17, 'code' => 'technology', 'apple_category' => 'Technology', 'google_category' => 'Technology'),
array('parent_id' => 0, 'id' => 18, 'code' => 'true_crime', 'apple_category' => 'True Crime', 'google_category' => ''),
array('parent_id' => 0, 'id' => 19, 'code' => 'tv_and_film', 'apple_category' => 'TV &amp; Film', 'google_category' => 'TV &amp; Film'),
array('parent_id' => 1, 'id' => 20, 'code' => 'books', 'apple_category' => 'Books', 'google_category' => ''),
array('parent_id' => 1, 'id' => 21, 'code' => 'design', 'apple_category' => 'Design', 'google_category' => ''),
array('parent_id' => 1, 'id' => 22, 'code' => 'fashion_and_beauty', 'apple_category' => 'Fashion &amp; Beauty', 'google_category' => ''),
array('parent_id' => 1, 'id' => 23, 'code' => 'food', 'apple_category' => 'Food', 'google_category' => ''),
array('parent_id' => 1, 'id' => 24, 'code' => 'performing_arts', 'apple_category' => 'Performing Arts', 'google_category' => ''),
array('parent_id' => 1, 'id' => 25, 'code' => 'visual_arts', 'apple_category' => 'Visual Arts', 'google_category' => ''),
array('parent_id' => 2, 'id' => 26, 'code' => 'careers', 'apple_category' => 'Careers', 'google_category' => ''),
array('parent_id' => 2, 'id' => 27, 'code' => 'entrepreneurship', 'apple_category' => 'Entrepreneurship', 'google_category' => ''),
array('parent_id' => 2, 'id' => 28, 'code' => 'investing', 'apple_category' => 'Investing', 'google_category' => ''),
array('parent_id' => 2, 'id' => 29, 'code' => 'management', 'apple_category' => 'Management', 'google_category' => ''),
array('parent_id' => 2, 'id' => 30, 'code' => 'marketing', 'apple_category' => 'Marketing', 'google_category' => ''),
array('parent_id' => 2, 'id' => 31, 'code' => 'non_profit', 'apple_category' => 'Non-Profit', 'google_category' => ''),
array('parent_id' => 3, 'id' => 32, 'code' => 'comedy_interviews', 'apple_category' => 'Comedy Interviews', 'google_category' => ''),
array('parent_id' => 3, 'id' => 33, 'code' => 'improv', 'apple_category' => 'Improv', 'google_category' => ''),
array('parent_id' => 3, 'id' => 34, 'code' => 'stand_up', 'apple_category' => 'Stand-Up', 'google_category' => ''),
array('parent_id' => 4, 'id' => 35, 'code' => 'courses', 'apple_category' => 'Courses', 'google_category' => ''),
array('parent_id' => 4, 'id' => 36, 'code' => 'how_to', 'apple_category' => 'How To', 'google_category' => ''),
array('parent_id' => 4, 'id' => 37, 'code' => 'language_learning', 'apple_category' => 'Language Learning', 'google_category' => ''),
array('parent_id' => 4, 'id' => 38, 'code' => 'self_improvement', 'apple_category' => 'Self-Improvement', 'google_category' => ''),
array('parent_id' => 5, 'id' => 39, 'code' => 'comedy_fiction', 'apple_category' => 'Comedy Fiction', 'google_category' => ''),
array('parent_id' => 5, 'id' => 40, 'code' => 'drama', 'apple_category' => 'Drama', 'google_category' => ''),
array('parent_id' => 5, 'id' => 41, 'code' => 'science_fiction', 'apple_category' => 'Science Fiction', 'google_category' => ''),
array('parent_id' => 7, 'id' => 42, 'code' => 'alternative_health', 'apple_category' => 'Alternative Health', 'google_category' => ''),
array('parent_id' => 7, 'id' => 43, 'code' => 'fitness', 'apple_category' => 'Fitness', 'google_category' => ''),
array('parent_id' => 7, 'id' => 44, 'code' => 'medicine', 'apple_category' => 'Medicine', 'google_category' => ''),
array('parent_id' => 7, 'id' => 45, 'code' => 'mental_health', 'apple_category' => 'Mental Health', 'google_category' => ''),
array('parent_id' => 7, 'id' => 46, 'code' => 'nutrition', 'apple_category' => 'Nutrition', 'google_category' => ''),
array('parent_id' => 7, 'id' => 47, 'code' => 'sexuality', 'apple_category' => 'Sexuality', 'google_category' => ''),
array('parent_id' => 9, 'id' => 48, 'code' => 'education_for_kids', 'apple_category' => 'Education for Kids', 'google_category' => ''),
array('parent_id' => 9, 'id' => 49, 'code' => 'parenting', 'apple_category' => 'Parenting', 'google_category' => ''),
array('parent_id' => 9, 'id' => 50, 'code' => 'pets_and_animals', 'apple_category' => 'Pets &amp; Animals', 'google_category' => ''),
array('parent_id' => 9, 'id' => 51, 'code' => 'stories_for_kids', 'apple_category' => 'Stories for Kids', 'google_category' => ''),
array('parent_id' => 10, 'id' => 52, 'code' => 'animation_and_manga', 'apple_category' => 'Animation &amp; Manga', 'google_category' => ''),
array('parent_id' => 10, 'id' => 53, 'code' => 'automotive', 'apple_category' => 'Automotive', 'google_category' => ''),
array('parent_id' => 10, 'id' => 54, 'code' => 'aviation', 'apple_category' => 'Aviation', 'google_category' => ''),
array('parent_id' => 10, 'id' => 55, 'code' => 'crafts', 'apple_category' => 'Crafts', 'google_category' => ''),
array('parent_id' => 10, 'id' => 56, 'code' => 'games', 'apple_category' => 'Games', 'google_category' => ''),
array('parent_id' => 10, 'id' => 57, 'code' => 'hobbies', 'apple_category' => 'Hobbies', 'google_category' => ''),
array('parent_id' => 10, 'id' => 58, 'code' => 'home_and_garden', 'apple_category' => 'Home &amp; Garden', 'google_category' => ''),
array('parent_id' => 10, 'id' => 59, 'code' => 'video_games', 'apple_category' => 'Video Games', 'google_category' => ''),
array('parent_id' => 11, 'id' => 60, 'code' => 'music_commentary', 'apple_category' => 'Music Commentary', 'google_category' => ''),
array('parent_id' => 11, 'id' => 61, 'code' => 'music_history', 'apple_category' => 'Music History', 'google_category' => ''),
array('parent_id' => 11, 'id' => 62, 'code' => 'music_interviews', 'apple_category' => 'Music Interviews', 'google_category' => ''),
array('parent_id' => 12, 'id' => 63, 'code' => 'business_news', 'apple_category' => 'Business News', 'google_category' => ''),
array('parent_id' => 12, 'id' => 64, 'code' => 'daily_news', 'apple_category' => 'Daily News', 'google_category' => ''),
array('parent_id' => 12, 'id' => 65, 'code' => 'entertainment_news', 'apple_category' => 'Entertainment News', 'google_category' => ''),
array('parent_id' => 12, 'id' => 66, 'code' => 'news_commentary', 'apple_category' => 'News Commentary', 'google_category' => ''),
array('parent_id' => 12, 'id' => 67, 'code' => 'politics', 'apple_category' => 'Politics', 'google_category' => ''),
array('parent_id' => 12, 'id' => 68, 'code' => 'sports_news', 'apple_category' => 'Sports News', 'google_category' => ''),
array('parent_id' => 12, 'id' => 69, 'code' => 'tech_news', 'apple_category' => 'Tech News', 'google_category' => ''),
array('parent_id' => 13, 'id' => 70, 'code' => 'buddhism', 'apple_category' => 'Buddhism', 'google_category' => ''),
array('parent_id' => 13, 'id' => 71, 'code' => 'christianity', 'apple_category' => 'Christianity', 'google_category' => ''),
array('parent_id' => 13, 'id' => 72, 'code' => 'hinduism', 'apple_category' => 'Hinduism', 'google_category' => ''),
array('parent_id' => 13, 'id' => 73, 'code' => 'islam', 'apple_category' => 'Islam', 'google_category' => ''),
array('parent_id' => 13, 'id' => 74, 'code' => 'judaism', 'apple_category' => 'Judaism', 'google_category' => ''),
array('parent_id' => 13, 'id' => 75, 'code' => 'religion', 'apple_category' => 'Religion', 'google_category' => ''),
array('parent_id' => 13, 'id' => 76, 'code' => 'spirituality', 'apple_category' => 'Spirituality', 'google_category' => ''),
array('parent_id' => 14, 'id' => 77, 'code' => 'astronomy', 'apple_category' => 'Astronomy', 'google_category' => ''),
array('parent_id' => 14, 'id' => 78, 'code' => 'chemistry', 'apple_category' => 'Chemistry', 'google_category' => ''),
array('parent_id' => 14, 'id' => 79, 'code' => 'earth_sciences', 'apple_category' => 'Earth Sciences', 'google_category' => ''),
array('parent_id' => 14, 'id' => 80, 'code' => 'life_sciences', 'apple_category' => 'Life Sciences', 'google_category' => ''),
array('parent_id' => 14, 'id' => 81, 'code' => 'mathematics', 'apple_category' => 'Mathematics', 'google_category' => ''),
array('parent_id' => 14, 'id' => 82, 'code' => 'natural_sciences', 'apple_category' => 'Natural Sciences', 'google_category' => ''),
array('parent_id' => 14, 'id' => 83, 'code' => 'nature', 'apple_category' => 'Nature', 'google_category' => ''),
array('parent_id' => 14, 'id' => 84, 'code' => 'physics', 'apple_category' => 'Physics', 'google_category' => ''),
array('parent_id' => 14, 'id' => 85, 'code' => 'social_sciences', 'apple_category' => 'Social Sciences', 'google_category' => ''),
array('parent_id' => 15, 'id' => 86, 'code' => 'documentary', 'apple_category' => 'Documentary', 'google_category' => ''),
array('parent_id' => 15, 'id' => 87, 'code' => 'personal_journals', 'apple_category' => 'Personal Journals', 'google_category' => ''),
array('parent_id' => 15, 'id' => 88, 'code' => 'philosophy', 'apple_category' => 'Philosophy', 'google_category' => ''),
array('parent_id' => 15, 'id' => 89, 'code' => 'places_and_travel', 'apple_category' => 'Places &amp; Travel', 'google_category' => ''),
array('parent_id' => 15, 'id' => 90, 'code' => 'relationships', 'apple_category' => 'Relationships', 'google_category' => ''),
array('parent_id' => 16, 'id' => 91, 'code' => 'baseball', 'apple_category' => 'Baseball', 'google_category' => ''),
array('parent_id' => 16, 'id' => 92, 'code' => 'basketball', 'apple_category' => 'Basketball', 'google_category' => ''),
array('parent_id' => 16, 'id' => 93, 'code' => 'cricket', 'apple_category' => 'Cricket', 'google_category' => ''),
array('parent_id' => 16, 'id' => 94, 'code' => 'fantasy_sports', 'apple_category' => 'Fantasy Sports', 'google_category' => ''),
array('parent_id' => 16, 'id' => 95, 'code' => 'football', 'apple_category' => 'Football', 'google_category' => ''),
array('parent_id' => 16, 'id' => 96, 'code' => 'golf', 'apple_category' => 'Golf', 'google_category' => ''),
array('parent_id' => 16, 'id' => 97, 'code' => 'hockey', 'apple_category' => 'Hockey', 'google_category' => ''),
array('parent_id' => 16, 'id' => 98, 'code' => 'rugby', 'apple_category' => 'Rugby', 'google_category' => ''),
array('parent_id' => 16, 'id' => 99, 'code' => 'running', 'apple_category' => 'Running', 'google_category' => ''),
array('parent_id' => 16, 'id' => 100, 'code' => 'soccer', 'apple_category' => 'Soccer', 'google_category' => ''),
array('parent_id' => 16, 'id' => 101, 'code' => 'swimming', 'apple_category' => 'Swimming', 'google_category' => ''),
array('parent_id' => 16, 'id' => 102, 'code' => 'tennis', 'apple_category' => 'Tennis', 'google_category' => ''),
array('parent_id' => 16, 'id' => 103, 'code' => 'volleyball', 'apple_category' => 'Volleyball', 'google_category' => ''),
array('parent_id' => 16, 'id' => 104, 'code' => 'wilderness', 'apple_category' => 'Wilderness', 'google_category' => ''),
array('parent_id' => 16, 'id' => 105, 'code' => 'wrestling', 'apple_category' => 'Wrestling', 'google_category' => ''),
array('parent_id' => 19, 'id' => 106, 'code' => 'after_shows', 'apple_category' => 'After Shows', 'google_category' => ''),
array('parent_id' => 19, 'id' => 107, 'code' => 'film_history', 'apple_category' => 'Film History', 'google_category' => ''),
array('parent_id' => 19, 'id' => 108, 'code' => 'film_interviews', 'apple_category' => 'Film Interviews', 'google_category' => ''),
array('parent_id' => 19, 'id' => 109, 'code' => 'film_reviews', 'apple_category' => 'Film Reviews', 'google_category' => ''),
array('parent_id' => 19, 'id' => 110, 'code' => 'tv_reviews', 'apple_category' => 'TV Reviews', 'google_category' => ''),
);
$this->db->table('categories')->insertBatch($data);

View File

@ -0,0 +1,200 @@
<?php
namespace App\Database\Seeds;
use CodeIgniter\Database\Seeder;
class LanguageSeeder extends Seeder
{
public function run()
{
$data = array(
array('code' => 'ab'),
array('code' => 'aa'),
array('code' => 'af'),
array('code' => 'ak'),
array('code' => 'sq'),
array('code' => 'am'),
array('code' => 'ar'),
array('code' => 'an'),
array('code' => 'hy'),
array('code' => 'as'),
array('code' => 'av'),
array('code' => 'ae'),
array('code' => 'ay'),
array('code' => 'az'),
array('code' => 'bm'),
array('code' => 'ba'),
array('code' => 'eu'),
array('code' => 'be'),
array('code' => 'bn'),
array('code' => 'bh'),
array('code' => 'bi'),
array('code' => 'bs'),
array('code' => 'br'),
array('code' => 'bg'),
array('code' => 'my'),
array('code' => 'ca'),
array('code' => 'km'),
array('code' => 'ch'),
array('code' => 'ce'),
array('code' => 'ny'),
array('code' => 'zh'),
array('code' => 'cu'),
array('code' => 'cv'),
array('code' => 'kw'),
array('code' => 'co'),
array('code' => 'cr'),
array('code' => 'hr'),
array('code' => 'cs'),
array('code' => 'da'),
array('code' => 'dv'),
array('code' => 'nl'),
array('code' => 'dz'),
array('code' => 'en'),
array('code' => 'eo'),
array('code' => 'et'),
array('code' => 'ee'),
array('code' => 'fo'),
array('code' => 'fj'),
array('code' => 'fi'),
array('code' => 'fr'),
array('code' => 'ff'),
array('code' => 'gd'),
array('code' => 'gl'),
array('code' => 'lg'),
array('code' => 'ka'),
array('code' => 'de'),
array('code' => 'ki'),
array('code' => 'el'),
array('code' => 'kl'),
array('code' => 'gn'),
array('code' => 'gu'),
array('code' => 'ht'),
array('code' => 'ha'),
array('code' => 'he'),
array('code' => 'hz'),
array('code' => 'hi'),
array('code' => 'ho'),
array('code' => 'hu'),
array('code' => 'is'),
array('code' => 'io'),
array('code' => 'ig'),
array('code' => 'id'),
array('code' => 'ia'),
array('code' => 'ie'),
array('code' => 'iu'),
array('code' => 'ik'),
array('code' => 'ga'),
array('code' => 'it'),
array('code' => 'ja'),
array('code' => 'jv'),
array('code' => 'kn'),
array('code' => 'kr'),
array('code' => 'ks'),
array('code' => 'kk'),
array('code' => 'rw'),
array('code' => 'kv'),
array('code' => 'kg'),
array('code' => 'ko'),
array('code' => 'kj'),
array('code' => 'ku'),
array('code' => 'ky'),
array('code' => 'lo'),
array('code' => 'la'),
array('code' => 'lv'),
array('code' => 'lb'),
array('code' => 'li'),
array('code' => 'ln'),
array('code' => 'lt'),
array('code' => 'lu'),
array('code' => 'mk'),
array('code' => 'mg'),
array('code' => 'ms'),
array('code' => 'ml'),
array('code' => 'mt'),
array('code' => 'gv'),
array('code' => 'mi'),
array('code' => 'mr'),
array('code' => 'mh'),
array('code' => 'ro'),
array('code' => 'mn'),
array('code' => 'na'),
array('code' => 'nv'),
array('code' => 'nd'),
array('code' => 'ng'),
array('code' => 'ne'),
array('code' => 'se'),
array('code' => 'no'),
array('code' => 'nb'),
array('code' => 'nn'),
array('code' => 'ii'),
array('code' => 'oc'),
array('code' => 'oj'),
array('code' => 'or'),
array('code' => 'om'),
array('code' => 'os'),
array('code' => 'pi'),
array('code' => 'pa'),
array('code' => 'ps'),
array('code' => 'fa'),
array('code' => 'pl'),
array('code' => 'pt'),
array('code' => 'qu'),
array('code' => 'rm'),
array('code' => 'rn'),
array('code' => 'ru'),
array('code' => 'sm'),
array('code' => 'sg'),
array('code' => 'sa'),
array('code' => 'sc'),
array('code' => 'sr'),
array('code' => 'sn'),
array('code' => 'sd'),
array('code' => 'si'),
array('code' => 'sk'),
array('code' => 'sl'),
array('code' => 'so'),
array('code' => 'st'),
array('code' => 'nr'),
array('code' => 'es'),
array('code' => 'su'),
array('code' => 'sw'),
array('code' => 'ss'),
array('code' => 'sv'),
array('code' => 'tl'),
array('code' => 'ty'),
array('code' => 'tg'),
array('code' => 'ta'),
array('code' => 'tt'),
array('code' => 'te'),
array('code' => 'th'),
array('code' => 'bo'),
array('code' => 'ti'),
array('code' => 'to'),
array('code' => 'ts'),
array('code' => 'tn'),
array('code' => 'tr'),
array('code' => 'tk'),
array('code' => 'tw'),
array('code' => 'ug'),
array('code' => 'uk'),
array('code' => 'ur'),
array('code' => 'uz'),
array('code' => 've'),
array('code' => 'vi'),
array('code' => 'vo'),
array('code' => 'wa'),
array('code' => 'cy'),
array('code' => 'fy'),
array('code' => 'wo'),
array('code' => 'xh'),
array('code' => 'yi'),
array('code' => 'yo'),
array('code' => 'za'),
array('code' => 'zu'),
);
$this->db->table('languages')->insertBatch($data);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entities;
use CodeIgniter\Entity;
class Language extends Entity
{
protected $casts = [
'code' => 'string',
];
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Entities;
use CodeIgniter\Entity;
class Podcast extends Entity
{
protected $casts = [
'title' => 'string',
'name' => 'string',
'description' => 'string',
'episode_description_footer' => '?string',
'image' => 'string',
'language' => 'string',
'category' => 'array',
'explicit' => 'boolean',
'author' => '?string',
'owner_name' => '?string',
'owner_email' => '?string',
'type' => '?string',
'copyright' => '?string',
'block' => 'boolean',
'complete' => 'boolean',
'custom_html_head' => '?string',
];
}

View File

@ -0,0 +1,327 @@
<?
return [
"create" => "Create a Podcast",
"form" => [
'title' => 'Title',
'name' => 'Name',
'description' => 'Description',
'episode_description_footer' => 'Episode description footer',
'image' => 'Image',
'language' => 'Language',
'category' => 'Category',
'explicit' => 'Explicit',
'author' => 'Author',
'owner_name' => 'Owner name',
'owner_email' => 'Owner email',
'type' => [
'label' => 'Type',
'episodic' => 'Episodic',
'serial' => 'Serial',
],
'copyright' => 'Copyright',
'block' => 'Block',
'complete' => 'Complete',
'custom_html_head' => 'Custom HTML code in <head/>',
'submit' => 'Create podcast',
],
"language_options" => [
'ab' => 'Abkhazian',
'aa' => 'Afar',
'af' => 'Afrikaans',
'ak' => 'Akan',
'sq' => 'Albanian',
'am' => 'Amharic',
'ar' => 'Arabic',
'an' => 'Aragonese',
'hy' => 'Armenian',
'as' => 'Assamese',
'av' => 'Avaric',
'ae' => 'Avestan',
'ay' => 'Aymara',
'az' => 'Azerbaijani',
'bm' => 'Bambara',
'ba' => 'Bashkir',
'eu' => 'Basque',
'be' => 'Belarusian',
'bn' => 'Bengali',
'bh' => 'Bihari languages',
'bi' => 'Bislama',
'bs' => 'Bosnian',
'br' => 'Breton',
'bg' => 'Bulgarian',
'my' => 'Burmese',
'ca' => 'Catalan, Valencian',
'km' => 'Central Khmer',
'ch' => 'Chamorro',
'ce' => 'Chechen',
'ny' => 'Chichewa, Chewa, Nyanja',
'zh' => 'Chinese',
'cu' => 'Church Slavonic, Old Bulgarian, Old Church Slavonic',
'cv' => 'Chuvash',
'kw' => 'Cornish',
'co' => 'Corsican',
'cr' => 'Cree',
'hr' => 'Croatian',
'cs' => 'Czech',
'da' => 'Danish',
'dv' => 'Divehi, Dhivehi, Maldivian',
'nl' => 'Dutch, Flemish',
'dz' => 'Dzongkha',
'en' => 'English',
'eo' => 'Esperanto',
'et' => 'Estonian',
'ee' => 'Ewe',
'fo' => 'Faroese',
'fj' => 'Fijian',
'fi' => 'Finnish',
'fr' => 'French',
'ff' => 'Fulah',
'gd' => 'Gaelic, Scottish Gaelic',
'gl' => 'Galician',
'lg' => 'Ganda',
'ka' => 'Georgian',
'de' => 'German',
'ki' => 'Gikuyu, Kikuyu',
'el' => 'Greek (Modern)',
'kl' => 'Greenlandic, Kalaallisut',
'gn' => 'Guarani',
'gu' => 'Gujarati',
'ht' => 'Haitian, Haitian Creole',
'ha' => 'Hausa',
'he' => 'Hebrew',
'hz' => 'Herero',
'hi' => 'Hindi',
'ho' => 'Hiri Motu',
'hu' => 'Hungarian',
'is' => 'Icelandic',
'io' => 'Ido',
'ig' => 'Igbo',
'id' => 'Indonesian',
'ia' => 'Interlingua (International Auxiliary Language Association)',
'ie' => 'Interlingue',
'iu' => 'Inuktitut',
'ik' => 'Inupiaq',
'ga' => 'Irish',
'it' => 'Italian',
'ja' => 'Japanese',
'jv' => 'Javanese',
'kn' => 'Kannada',
'kr' => 'Kanuri',
'ks' => 'Kashmiri',
'kk' => 'Kazakh',
'rw' => 'Kinyarwanda',
'kv' => 'Komi',
'kg' => 'Kongo',
'ko' => 'Korean',
'kj' => 'Kwanyama, Kuanyama',
'ku' => 'Kurdish',
'ky' => 'Kyrgyz',
'lo' => 'Lao',
'la' => 'Latin',
'lv' => 'Latvian',
'lb' => 'Letzeburgesch, Luxembourgish',
'li' => 'Limburgish, Limburgan, Limburger',
'ln' => 'Lingala',
'lt' => 'Lithuanian',
'lu' => 'Luba-Katanga',
'mk' => 'Macedonian',
'mg' => 'Malagasy',
'ms' => 'Malay',
'ml' => 'Malayalam',
'mt' => 'Maltese',
'gv' => 'Manx',
'mi' => 'Maori',
'mr' => 'Marathi',
'mh' => 'Marshallese',
'ro' => 'Moldovan, Moldavian, Romanian',
'mn' => 'Mongolian',
'na' => 'Nauru',
'nv' => 'Navajo, Navaho',
'nd' => 'Northern Ndebele',
'ng' => 'Ndonga',
'ne' => 'Nepali',
'se' => 'Northern Sami',
'no' => 'Norwegian',
'nb' => 'Norwegian Bokmål',
'nn' => 'Norwegian Nynorsk',
'ii' => 'Nuosu, Sichuan Yi',
'oc' => 'Occitan (post 1500)',
'oj' => 'Ojibwa',
'or' => 'Oriya',
'om' => 'Oromo',
'os' => 'Ossetian, Ossetic',
'pi' => 'Pali',
'pa' => 'Panjabi, Punjabi',
'ps' => 'Pashto, Pushto',
'fa' => 'Persian',
'pl' => 'Polish',
'pt' => 'Portuguese',
'qu' => 'Quechua',
'rm' => 'Romansh',
'rn' => 'Rundi',
'ru' => 'Russian',
'sm' => 'Samoan',
'sg' => 'Sango',
'sa' => 'Sanskrit',
'sc' => 'Sardinian',
'sr' => 'Serbian',
'sn' => 'Shona',
'sd' => 'Sindhi',
'si' => 'Sinhala, Sinhalese',
'sk' => 'Slovak',
'sl' => 'Slovenian',
'so' => 'Somali',
'st' => 'Sotho, Southern',
'nr' => 'South Ndebele',
'es' => 'Spanish, Castilian',
'su' => 'Sundanese',
'sw' => 'Swahili',
'ss' => 'Swati',
'sv' => 'Swedish',
'tl' => 'Tagalog',
'ty' => 'Tahitian',
'tg' => 'Tajik',
'ta' => 'Tamil',
'tt' => 'Tatar',
'te' => 'Telugu',
'th' => 'Thai',
'bo' => 'Tibetan',
'ti' => 'Tigrinya',
'to' => 'Tonga (Tonga Islands)',
'ts' => 'Tsonga',
'tn' => 'Tswana',
'tr' => 'Turkish',
'tk' => 'Turkmen',
'tw' => 'Twi',
'ug' => 'Uighur, Uyghur',
'uk' => 'Ukrainian',
'ur' => 'Urdu',
'uz' => 'Uzbek',
've' => 'Venda',
'vi' => 'Vietnamese',
'vo' => 'Volap_k',
'wa' => 'Walloon',
'cy' => 'Welsh',
'fy' => 'Western Frisian',
'wo' => 'Wolof',
'xh' => 'Xhosa',
'yi' => 'Yiddish',
'yo' => 'Yoruba',
'za' => 'Zhuang, Chuang',
'zu' => 'Zulu',
],
'category_options' => [
'uncategorized' => 'uncategorized',
'arts' => 'Arts',
'business' => 'Business',
'comedy' => 'Comedy',
'education' => 'Education',
'fiction' => 'Fiction',
'government' => 'Government',
'health_and_fitness' => 'Health &amp Fitness',
'history' => 'History',
'kids_and_family' => 'Kids &amp Family',
'leisure' => 'Leisure',
'music' => 'Music',
'news' => 'News',
'religion_and_spirituality' => 'Religion &amp Spirituality',
'science' => 'Science',
'society_and_culture' => 'Society &amp Culture',
'sports' => 'Sports',
'technology' => 'Technology',
'true_crime' => 'True Crime',
'tv_and_film' => 'TV &amp Film',
'books' => 'Books',
'design' => 'Design',
'fashion_and_beauty' => 'Fashion &amp Beauty',
'food' => 'Food',
'performing_arts' => 'Performing Arts',
'visual_arts' => 'Visual Arts',
'careers' => 'Careers',
'entrepreneurship' => 'Entrepreneurship',
'investing' => 'Investing',
'management' => 'Management',
'marketing' => 'Marketing',
'non_profit' => 'Non-Profit',
'comedy_interviews' => 'Comedy Interviews',
'improv' => 'Improv',
'stand_up' => 'Stand-Up',
'courses' => 'Courses',
'how_to' => 'How To',
'language_learning' => 'Language Learning',
'self-improvement' => 'Self-Improvement',
'comedy_fiction' => 'Comedy Fiction',
'drama' => 'Drama',
'science_fiction' => 'Science Fiction',
'alternative_health' => 'Alternative Health',
'fitness' => 'Fitness',
'medicine' => 'Medicine',
'mental_health' => 'Mental Health',
'nutrition' => 'Nutrition',
'sexuality' => 'Sexuality',
'education_for_kids' => 'Education for Kids',
'parenting' => 'Parenting',
'pets_and_animals' => 'Pets &amp Animals',
'stories_for_kids' => 'Stories for Kids',
'animation_and_manga' => 'Animation &amp Manga',
'automotive' => 'Automotive',
'aviation' => 'Aviation',
'crafts' => 'Crafts',
'games' => 'Games',
'hobbies' => 'Hobbies',
'home_and_garden' => 'Home &amp Garden',
'video_games' => 'Video Games',
'music_commentary' => 'Music Commentary',
'music_history' => 'Music History',
'music_interviews' => 'Music Interviews',
'business_news' => 'Business News',
'daily_news' => 'Daily News',
'entertainment_news' => 'Entertainment News',
'news_commentary' => 'News Commentary',
'politics' => 'Politics',
'sports_news' => 'Sports News',
'tech_news' => 'Tech News',
'buddhism' => 'Buddhism',
'christianity' => 'Christianity',
'hinduism' => 'Hinduism',
'islam' => 'Islam',
'judaism' => 'Judaism',
'religion' => 'Religion',
'spirituality' => 'Spirituality',
'astronomy' => 'Astronomy',
'chemistry' => 'Chemistry',
'earth_sciences' => 'Earth Sciences',
'life_sciences' => 'Life Sciences',
'mathematics' => 'Mathematics',
'natural_sciences' => 'Natural Sciences',
'nature' => 'Nature',
'physics' => 'Physics',
'social_sciences' => 'Social Sciences',
'documentary' => 'Documentary',
'personal_journals' => 'Personal Journals',
'philosophy' => 'Philosophy',
'places_and_travel' => 'Places &amp Travel',
'relationships' => 'Relationships',
'baseball' => 'Baseball',
'basketball' => 'Basketball',
'cricket' => 'Cricket',
'fantasy_sports' => 'Fantasy Sports',
'football' => 'Football',
'golf' => 'Golf',
'hockey' => 'Hockey',
'rugby' => 'Rugby',
'running' => 'Running',
'soccer' => 'Soccer',
'swimming' => 'Swimming',
'tennis' => 'Tennis',
'volleyball' => 'Volleyball',
'wilderness' => 'Wilderness',
'wrestling' => 'Wrestling',
'after_shows' => 'After Shows',
'film_history' => 'Film History',
'film_interviews' => 'Film Interviews',
'film_reviews' => 'Film Reviews',
'tv_reviews' => 'TV Reviews',
],
];

View File

@ -6,15 +6,15 @@ use CodeIgniter\Model;
class CategoryModel extends Model
{
protected $table = 'categories';
protected $table = 'categories';
protected $primaryKey = 'id';
protected $allowedFields = [
'apple_category', 'google_category'
'apple_category', 'google_category',
];
protected $returnType = 'App\Entities\Category';
protected $returnType = 'App\Entities\Category';
protected $useSoftDeletes = false;
protected $useTimestamps = true;
protected $useTimestamps = false;
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class LanguageModel extends Model
{
protected $table = 'languages';
protected $primaryKey = 'id';
protected $allowedFields = [
'code',
];
protected $returnType = 'App\Entities\Language';
protected $useSoftDeletes = false;
protected $useTimestamps = false;
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class PodcastModel extends Model
{
protected $table = 'podcasts';
protected $primaryKey = 'id';
protected $allowedFields = [
'title',
'name',
'description',
'episode_description_footer',
'image',
'language',
'category',
'explicit',
'author',
'owner_name',
'owner_email',
'type',
'copyright',
'block',
'complete',
'custom_html_head',
];
protected $returnType = 'App\Entities\Podcast';
protected $useSoftDeletes = false;
protected $useTimestamps = true;
}

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Castopod</title>
<meta name="description" content="Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="/favicon.ico"/>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="container mx-auto py-10">
<?=$this->renderSection('content')?>
</body>

View File

@ -0,0 +1,111 @@
<?=helper('form')?>
<?=$this->extend('layouts\default')?>
<?=$this->section('content')?>
<h1 class="text-xl mb-6"><?=lang("Podcasts.create")?></h1>
<div class="mb-8">
<?=\Config\Services::validation()->listErrors()?>
</div>
<?=form_open_multipart('/podcast/create', ["method" => "post", "class" => "flex flex-col max-w-md"])?>
<?=csrf_field()?>
<div class="flex flex-col mb-4">
<label for="title"><?=lang("Podcasts.form.title")?></label>
<input type="text" class="border py-2 px-4" id="title" name="title" required />
</div>
<div class="flex flex-col mb-4">
<label for="name"><?=lang("Podcasts.form.name")?></label>
<input type="text" class="border py-2 px-4" id="name" name="name" required />
</div>
<div class="flex flex-col mb-4">
<label for="description"><?=lang("Podcasts.form.description")?></label>
<textarea class="border py-2 px-4" id="description" name="description" required></textarea>
</div>
<div class="flex flex-col mb-4">
<label for="episode_description_footer"><?=lang("Podcasts.form.episode_description_footer")?></label>
<textarea class="border py-2 px-4" id="episode_description_footer" name="episode_description_footer"></textarea>
</div>
<div class="flex flex-col mb-4">
<label for="image"><?=lang("Podcasts.form.image")?></label>
<input type="file" class="border py-2 px-4" id="image" name="image" required />
</div>
<div class="flex flex-col mb-4">
<label for="language"><?=lang("Podcasts.form.language")?></label>
<select id="language" name="language" autocomplete="off" class="border" required>
<?php foreach ($languages as $language): ?>
<option <?=($language->code == $browser_lang) ? "selected='selected'" : ""?> value="<?=$language->code?>"><?=lang("Podcasts.language_options." . $language->code)?></option>
<?php endforeach?>
</select>
</div>
<div class="flex flex-col mb-4">
<label for="category"><?=lang("Podcasts.form.category")?></label>
<select id="category" name="category" class="border" required>
<?php foreach ($categories as $category): ?>
<option value="<?=$category->code?>"><?=lang("Podcasts.category_options." . $category->code)?></option>
<?php endforeach?>
</select>
</div>
<div class="flex items-baseline mb-4">
<input type="checkbox" id="explicit" name="explicit"/>
<label for="explicit" class="pl-2"><?=lang("Podcasts.form.explicit")?></label>
</div>
<div class="flex flex-col mb-4">
<label for="author"><?=lang("Podcasts.form.author")?></label>
<input type="text" class="border py-2 px-4" id="author" name="author"/>
</div>
<div class="flex flex-col mb-4">
<label for="owner_name"><?=lang("Podcasts.form.owner_name")?></label>
<input type="text" class="border py-2 px-4" id="owner_name" name="owner_name"/>
</div>
<div class="flex flex-col mb-4">
<label for="owner_email"><?=lang("Podcasts.form.owner_email")?></label>
<input type="email" class="border py-2 px-4" id="owner_email" name="owner_email" required />
</div>
<fieldset class="mb-4">
<legend><?=lang("Podcasts.form.type.label")?></legend>
<input type="radio" class="border py-2 px-4" value="episodic" id="episodic" name="type" checked="checked"/>
<label for="episodic"><?=lang("Podcasts.form.type.episodic")?></label><br/>
<input type="radio" class="border py-2 px-4" value="serial" id="serial" name="type"/>
<label for="serial"><?=lang("Podcasts.form.type.serial")?></label><br/>
</fieldset>
<div class="flex flex-col mb-4">
<label for="copyright"><?=lang("Podcasts.form.copyright")?></label>
<input type="text" class="border py-2 px-4" id="copyright" name="copyright"/>
</div>
<div class="flex items-baseline mb-4">
<input type="checkbox" id="block" name="block"/>
<label for="block" class="pl-2"><?=lang("Podcasts.form.block")?></label>
</div>
<div class="flex items-baseline mb-4">
<input type="checkbox" id="complete" name="complete"/>
<label for="complete" class="pl-2"><?=lang("Podcasts.form.complete")?></label>
</div>
<div class="flex flex-col mb-4">
<label for="custom_html_head"><?=esc(lang("Podcasts.form.custom_html_head"))?></label>
<textarea class="border py-2 px-4" id="custom_html_head" name="custom_html_head"></textarea>
</div>
<button type="submit" name="submit" class="bg-gray-200 py-2 px-1"><?=lang("Podcasts.form.submit")?></button>
<?=form_close()?>
<?=$this->endSection()?>

View File

@ -0,0 +1,5 @@
<?=$this->extend('layouts\default')?>
<?=$this->section('content')?>
<h1 class="text-xl">Podcast Page!</h1>
<?=$this->endSection()?>

View File

@ -0,0 +1 @@
Success!