public function validateClipCode($code, $provider = null) { if (SPVIDEOLITE_BOL_Configs::getInstance()->get('tweaks.force_https_compat')) { $code = str_replace("http://", "//", $code); $code = str_replace("https://", "//", $code); } // alternative way to validate embed code $iframeTag = "/<iframe.+?<\\/iframe>/is"; $embedTag = "/<embed.+?<\\/embed>/is"; $objectTag = "/<object.+?<\\/object>/is"; $videoTag = "/<video.+?<\\/video>/is"; $matches = array(); if (preg_match_all($iframeTag, $code, $matches)) { return $matches[0][0]; } if (preg_match_all($embedTag, $code, $matches)) { return $matches[0][0]; } if (preg_match_all($objectTag, $code, $matches)) { return $matches[0][0]; } if (preg_match_all($videoTag, $code, $matches)) { return $matches[0][0]; } return ''; }
public static function getInstance() { if (null === self::$classInstance) { self::$classInstance = new self(); } return self::$classInstance; }
public function index() { $this->assign('staticUrl', OW::getPluginManager()->getPlugin('spvideolite')->getStaticUrl()); $this->assign('embedForm', $this->embedForm); $this->addComponent('dragDropCmp', OW::getClassInstance('SPVIDEOLITE_CMP_AjaxUpload')); // call selected module upload template $module = SPVIDEOLITE_BOL_Configs::getInstance()->get('processor'); $func = 'add'; if (SPVIDEOLITE_BOL_Configs::getInstance()->get('features.upload_video')) { $viewPath = SPVIDEOLITE_BOL_Service::callProcessorFunction($module, 'getViewPath', $this); $view = $func . '.html'; $this->assign('uploadFormTpl', $viewPath . DS . $view); SPVIDEOLITE_BOL_Service::callProcessorFunction($module, $func, $this); } }
* * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } define('SPVIDEOLITE_DIR_ROOT', dirname(__FILE__)); define('SPVIDEOLITE_DIR_PROCESSORS', SPVIDEOLITE_DIR_ROOT . DS . 'processors'); define('SPVIDEOLITE_DIR_IMPORTERS', SPVIDEOLITE_DIR_ROOT . DS . 'importers'); define('SPVIDEOLITE_DIR_USERFILES', OW::getPluginManager()->getPlugin('spvideolite')->getUserFilesDir()); define('SPVIDEOLITE_DIR_PLUGINFILES', OW::getPluginManager()->getPlugin('spvideolite')->getPluginFilesDir()); $spvlConfig = SPVIDEOLITE_BOL_Configs::getInstance(); // Routers declaration OW::getRouter()->addRoute(new OW_Route('spvideolite.admin', 'admin/plugins/spvideolite', 'SPVIDEOLITE_CTRL_Admin', 'index')); OW::getRouter()->addRoute(new OW_Route('spvideolite.admin_upload', 'admin/plugins/spvideolite/upload', 'SPVIDEOLITE_CTRL_Admin', 'upload')); OW::getRouter()->addRoute(new OW_Route('spvideolite.admin_processor', 'admin/plugins/spvideolite/processor', 'SPVIDEOLITE_CTRL_Admin', 'processor')); OW::getRouter()->addRoute(new OW_Route('spvideolite.admin_help', 'admin/plugins/spvideolite/help', 'SPVIDEOLITE_CTRL_Admin', 'help')); OW::getRouter()->addRoute(new OW_Route('spvideolite.admin_saveconfig', 'admin/plugins/spvideolite/saveconfig', 'SPVIDEOLITE_CTRL_Admin', 'saveconfig')); OW::getRouter()->addRoute(new OW_Route('spvideolite.ajax_get_clip', 'spvideo/ajax_get_clip', 'SPVIDEOLITE_CTRL_Spvideo', 'ajaxGetClip')); OW::getRouter()->addRoute(new OW_Route('spvideolite.base', 'spvideo', 'SPVIDEOLITE_CTRL_Spvideo', 'index')); OW::getRouter()->addRoute(new OW_Route('spvideolite.my_video', 'spvideo/my', 'SPVIDEOLITE_CTRL_Spvideo', 'myVideo')); OW::getRouter()->addRoute(new OW_Route('spvideolite.embed', 'spvideo/embed/:videoId', 'SPVIDEOLITE_CTRL_Spvideo', 'embed')); OW::getRouter()->addRoute(new OW_Route('spvideolite.vidzi', 'spvideo/vidzi/:videoId', 'SPVIDEOLITE_CTRL_Vidzi', 'embed')); OW::getRouter()->addRoute(new OW_Route('spvideolite.videojs.fbembed', 'spvideo/fbembed/:videoId', 'SPVIDEOLITE_CTRL_Videojs', 'fbEmbed')); // compatible with older version OW::getRouter()->addRoute(new OW_Route('spvideolite.videojs.old_fbembed', 'spvideolite/fbembed/:videoId', 'SPVIDEOLITE_CTRL_Videojs', 'fbEmbed')); OW::getRouter()->addRoute(new OW_Route('spvideolite.import', 'spvideo/import', 'SPVIDEOLITE_CTRL_Spvideo', 'import'));
public function saveconfig(array $params) { SPVIDEOLITE_BOL_Configs::getInstance()->set($_POST['key'], $_POST['value']); die; }