/** * Submit revision. * * @param array $settings * @return null */ protected function submit_settings($settings) { $license = $this->has_custom_license($settings['license']) ? $settings['custom_license'] : $settings['license']; $this->revision->__set_array(array('revision_name' => $settings['name'], 'revision_license' => $license)); if ($this->is_moderator) { $can_change_status = !$this->is_author || $this->ext_config->allow_self_validation || $this->user->data['user_type'] == USER_FOUNDER; // Update the status if ($settings['status'] != $this->revision->revision_status && $settings['status'] != TITANIA_REVISION_APPROVED && $can_change_status) { $this->revision->change_status($settings['status']); } // Update the phpBB versions $this->revision->phpbb_versions = array(); foreach ($settings['vendor_versions'] as $version) { $branch = (int) $version[0] . (int) $version[2]; $release = substr($version, 4); if (!isset($this->vendor_versions[$branch . $release])) { // Have we added some new phpBB version that does not exist? We need to purge the cache then $this->cache->destroy('_titania_phpbb_versions'); } // Update the list of phpbb_versions for the revision to update $this->revision->phpbb_versions[] = array('phpbb_version_branch' => $branch, 'phpbb_version_revision' => $release); } } $this->translations->get_operator()->submit(); $this->revision->submit(); }
/** * Submit ColorizeIt settings. * * @return null */ protected function submit_colorizeit() { // ColorizeIt stuff if ($this->use_colorizeit) { $this->colorizeit_sample->get_operator()->submit(); $contrib_clr_colors = $this->request->variable('change_colors', $this->contrib->contrib_clr_colors); $this->contrib->__set('contrib_clr_colors', $contrib_clr_colors); } }
/** * Load attachment * * @param int $id Attachment id * @return bool Returns true if the attachment loaded successfully */ protected function load_attachment($id) { $operator = $this->uploader->get_operator(); $attachment = $operator->load(array((int) $id), true, $this->user->data['user_id'])->get($id); $valid = false; if ($attachment && $attachment->object_type == TITANIA_CONTRIB && $attachment->object_id == $this->contrib->contrib_id && $attachment->get('is_orphan')) { $this->attachment = $attachment; $valid = true; } return $valid; }
/** * Check whether any attachments are loaded. * * @return bool */ public function has_attachments() { return (bool) $this->uploader->get_operator()->get_count(); }