/** * Create a list of category names to add to the new file page * @param array $addlCategories * @return array $categories */ public function generateCategories(array $addlCategories) { wfProfileIn(__METHOD__); $addlCategories[] = $this->videoData['name']; if (!empty($this->videoData['type'])) { $addlCategories[] = $this->getPageCategory($this->videoData['type']); } $addlCategories = array_merge($addlCategories, $this->getAdditionalPageCategories($addlCategories)); // add language if (!empty($this->videoData['language']) && !preg_match("/\\benglish\\b/i", $this->videoData['language'])) { $addlCategories[] = 'International'; $addlCategories[] = $this->videoData['language']; } if (preg_match('\\(VG\\)', $this->videoData['titleName']) !== false) { $addlCategories[] = 'Games'; } else { $addlCategories[] = 'Entertainment'; } $addlCategories[] = 'Screenplay'; wfProfileOut(__METHOD__); return preg_replace('/\\s*,\\s*/', ' ', wfGetUniqueArrayCI($addlCategories)); }
/** * Create a list of category names to add to the new file page * @param array $addlCategories * @return array $categories */ public function generateCategories(array $addlCategories) { $addlCategories[] = $this->getVideoData('name'); $addlCategories[] = $this->getVideoData('series'); $addlCategories[] = $this->getVideoData('category'); // VID-1736 Remove video title from categories $titleKey = array_search($this->videoData['titleName'], $addlCategories); if ($titleKey !== false) { unset($addlCategories[$titleKey]); } $addlCategories = array_merge($addlCategories, $this->getAdditionalPageCategories($addlCategories)); // add language if (!empty($this->videoData['language']) && !preg_match("/\\benglish\\b/i", $this->videoData['language'])) { $addlCategories[] = 'International'; $addlCategories[] = $this->videoData['language']; } // add subtitle if (!empty($this->videoData['subtitle']) && !preg_match("/\\benglish\\b/i", $this->videoData['subtitle'])) { $addlCategories[] = 'International'; $addlCategories[] = $this->videoData['subtitle']; } $addlCategories[] = 'IVA'; return preg_replace('/\\s*,\\s*/', ' ', wfGetUniqueArrayCI($addlCategories)); }
/** * Create a list of category names to add to the new file page * @param array $addlCategories * @return array $categories */ public function generateCategories(array $addlCategories) { wfProfileIn(__METHOD__); $addlCategories[] = 'AnyClip'; $addlCategories[] = 'Entertainment'; if (preg_match('/trailer/', $this->videoData['titleName'])) { $addlCategories[] = 'Trailers'; } if (!empty($this->videoData['name'])) { $addlCategories[] = $this->videoData['name']; $addition = $this->getAdditionalPageCategory($this->videoData['name']); if (!empty($addition)) { $addlCategories[] = $addition; } } wfProfileOut(__METHOD__); return wfGetUniqueArrayCI($addlCategories); }
/** * Create a list of category names to add to the new file page * @param array $addlCategories * @return array $categories */ public function generateCategories(array $addlCategories) { wfProfileIn(__METHOD__); $addlCategories[] = 'Anime'; $addlCategories[] = 'Crunchyroll'; $addlCategories[] = $this->videoData['series']; $addlCategories[] = 'Entertainment'; if (!empty($this->videoData['season'])) { $addlCategories[] = $this->videoData['series'] . ': ' . $this->videoData['season']; } wfProfileOut(__METHOD__); return wfGetUniqueArrayCI($addlCategories); }
/** * Create list of category names to add to the new file page * @param array $addlCategories * @return array $categories */ public function generateCategories(array $addlCategories) { wfProfileIn(__METHOD__); if (!empty($this->videoData['name'])) { $addlCategories = array_merge($addlCategories, array_map('trim', explode(',', $this->videoData['name']))); } if (!empty($this->videoData['pageCategories'])) { $stdCategories = array_map(array($this, 'getPageCategory'), explode(',', $this->videoData['pageCategories'])); $addlCategories = array_merge($addlCategories, $stdCategories); } // remove 'the' category $key = array_search('the', array_map('strtolower', $addlCategories)); if ($key !== false) { unset($addlCategories[$key]); } if (!empty($this->videoData['categoryName'])) { $addlCategories[] = $this->videoData['categoryName']; } $addlCategories = array_merge($addlCategories, $this->getAdditionalPageCategories($addlCategories)); $addlCategories[] = 'Ooyala'; wfProfileOut(__METHOD__); return wfGetUniqueArrayCI($addlCategories); }