function __construct() { global $CONFIG; try { parent::__construct($CONFIG->dataroot . 'izap_queue_db/queue.db'); $this->setup(); } catch (PDOException $e) { register_error(elgg_echo("izap_videos:error:sqliteDrivers")); izapAdminSettings_izap_videos('izapVideoOptions', array('OFFSERVER', 'EMBED'), TRUE); izapAdminSettings_izap_videos('izap_cron_time', 'none', TRUE); } }
* Original developer of the iZAP Videos plugin: * @package Elgg videotizer, by iZAP Web Solutions * @license GNU Public License version 2 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ $Fail_functions = ini_get('disable_functions'); // $php_version = phpversion(); $exec = !strstr($Fail_functions, 'exec') && is_callable('exec') ? true : false; $curl = extension_loaded('curl') ? true : false; $ffmpeg_path = current(explode(' ', izapAdminSettings_izap_videos('izapVideoCommand'))); $pdo_sqlite = extension_loaded('pdo_sqlite') ? true : false; if ($exec) { $php_command = exec(izapAdminSettings_izap_videos('izapPhpInterpreter') . ' --version', $output_PHP, $return_value); if ($return_value === 0) { $php = nl2br(implode('', $output_PHP)); } $ffmpeg_command = exec($ffmpeg_path . ' -version', $output_FFmpeg, $return_var); if ($return_var === 0) { $ffmpeg = nl2br(implode($output_FFmpeg)); $in_video = elgg_get_plugins_path() . 'izap_videos/server_test/test_video.avi'; $izap_videos = new IzapVideos(); $izap_videos->owner_guid = elgg_get_logged_in_user_guid(); $izap_videos->setFilename('izap_videos/server_test/test_video.avi'); $izap_videos->open('write'); $izap_videos->write(file_get_contents($in_video)); $in_video = $izap_videos->getFilenameOnFilestore(); if (!file_exists($in_video)) { $in_video = elgg_get_plugins_path() . 'izap_videos/server_test/test_video.avi';
$postedArray['izapTopBarWidget'] = 'NO'; } // get tag area3 settings if (!empty($postedArray['izapTagCloud'])) { $postedArray['izapTagCloud'] = 'YES'; } else { $postedArray['izapTagCloud'] = 'NO'; } // get the credit if (!empty($postedArray['izapGiveUsCredit'])) { $postedArray['izapGiveUsCredit'] = 'YES'; } else { $postedArray['izapGiveUsCredit'] = 'NO'; } // get to keep values if (!empty($postedArray['izapKeepOriginal'])) { $postedArray['izapKeepOriginal'] = 'YES'; } else { $postedArray['izapKeepOriginal'] = 'NO'; } foreach ($postedArray as $key => $values) { izapAdminSettings_izap_videos($key, $values, TRUE); if ($key == 'izapVideoOptions') { if (in_array('ONSERVER', $values)) { $queue_object = new izapQueue(); } } } system_message(elgg_echo('izap_videos:success:adminSettingsSaved')); forward($_SERVER['HTTP_REFERER']); exit;
<?php /** * iZAP izap_videos * * @package Elgg videotizer, by iZAP Web Solutions. * @license GNU Public License version 3 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ if (izapAdminSettings_izap_videos('izapTagCloud') == 'YES') { $pageOwner = page_owner_entity(); // get categories $categories = elgg_view('categories/list', array('baseurl' => $CONFIG->wwwroot . 'search/?subtype=izap_videos&tagtype=universal_categories&tag=', 'owner_guid' => $pageOwner->guid)); if (!empty($categories)) { $area3 .= '<div class="contentWrapper">' . $categories . '</div>'; } // get tags $tags = display_tagcloud(0, 50, 'tags', 'object', 'izap_videos', '', ''); if ($tags != '') { $area3 .= '<div class="contentWrapper">'; $area2 .= elgg_view_title(elgg_echo('izap_videos:tagcloud')); $area3 .= $tags; $area3 .= '</div>'; } } echo $area3;
<?php /** * Post comment on videos river view */ elgg_load_js('lightbox'); elgg_load_css('lightbox'); $item = $vars['item']; $subject = $item->getSubjectEntity(); $comment = $item->getObjectEntity(); $target = $item->getTargetEntity(); $subject_link = elgg_view('output/url', array('href' => $subject->getURL(), 'text' => $subject->name, 'class' => 'elgg-river-subject', 'is_trusted' => true)); $target_link = elgg_view('output/url', array('href' => $target->getURL(), 'text' => $target->title, 'class' => 'elgg-river-target', 'is_trusted' => true)); $attachments = ''; $size = izapAdminSettings_izap_videos('izap_river_thumbnails'); if ($size != 'none') { $attachments = elgg_view_entity_icon($target, $size, array('href' => 'ajax/view/izap_videos/playpopup?guid=' . $target->getGUID(), 'title' => $target->title, 'img_class' => 'screenshot', 'link_class' => 'elgg-lightbox')); } echo elgg_view('river/elements/layout', array('item' => $vars['item'], 'attachments' => $attachments, 'summary' => elgg_echo('river:comment:object:izap_videos', array($subject_link, $target_link)), 'message' => elgg_get_excerpt($comment->description)));
/** * iZAP Videos plugin by iionly * (based on version 3.71b of the original izap_videos plugin for Elgg 1.7) * Contact: iionly@gmx.de * https://github.com/iionly * * Original developer of the iZAP Videos plugin: * @package Elgg videotizer, by iZAP Web Solutions * @license GNU Public License version 2 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ $maxFileSize = (int) izapAdminSettings_izap_videos('izapMaxFileSize'); ?> <div class="mbm"> <label for="video_file"> <?php echo elgg_echo('izap_videos:addEditForm:videoFile') . ' ' . elgg_echo('izap_videos:addEditForm:maxFilesize', array($maxFileSize)); ?> </label> <?php echo elgg_view('input/file', array('name' => 'izap[videoFile]', 'value' => $vars['loaded_data']->videoFile, 'id' => 'video_file')); ?> <span class="elgg-subtext"> <?php echo elgg_echo('izap_videos:ONSERVER:supported_formats'); ?>
<?php /** * iZAP izap_videos * * @package Elgg videotizer, by iZAP Web Solutions. * @license GNU Public License version 3 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ if (izapAdminSettings_izap_videos('izapGiveUsCredit') == 'YES') { ?> <div class="izap_credit" align="right" style="font-size:10px;"> <a href="http://www.izap.in/" target="_blank"> <img src="<?php echo $vars['url']; ?> mod/izap_videos/_graphics/powered-by-izap.png" alt="Powered by iZAP" /> </a> </div> <?php }
/** * this function will tell if the admin wants to include the top bar upload button * * @return boolean true for yes and false for no */ function izapTopBarWidget_izap_videos() { $var = izapAdminSettings_izap_videos('izapTopBarWidget', 'YES'); if ($var == 'NO') { return FALSE; } return TRUE; }
/** * This function actually converts the video * @param string $file file loacation * @param int $videoId video guid * @param int $ownerGuid video owner guid * @param int $accessId access id * @return boolean */ function izapConvertVideo_izap_videos($file, $videoId, $videoTitle, $videoUrl, $ownerGuid, $accessId = 2) { $return = false; // Works only if we have the input file if (file_exists($file)) { // Need to set flag for the file going in the conversion $queue_object = new izapQueue(); $queue_object->change_conversion_flag($videoId); $video = new izapConvert($file); $videofile = $video->izap_video_convert(); // Check if everything is ok if (!is_array($videofile)) { // If everything is ok then get back values to save $file_values = $video->getValues(); $izap_videofile = 'izap_videos/uploaded/' . $file_values['filename']; $izap_origfile = 'izap_videos/uploaded/' . $file_values['origname']; $izap_videos = get_entity($videoId); $izap_videos->setFilename($izap_videofile); $izap_videos->open("write"); $izap_videos->write($file_values['filecontent']); // Check if we have to keep original file if (izapAdminSettings_izap_videos('izapKeepOriginal') == 'YES') { $izap_videos->setFilename($izap_origfile); $izap_videos->open("write"); $izap_videos->write($file_values['origcontent']); } $izap_videos->converted = 'yes'; $izap_videos->videofile = $izap_videofile; $izap_videos->orignalfile = $izap_origfile; notify_user($ownerGuid, elgg_get_site_entity()->getGUID(), elgg_echo('izap_videos:notifySub:videoConverted'), elgg_echo('izap_videos:notifyMsg:videoConverted', array($videoUrl))); return true; } else { $errorReason = $videofile['message']; } } else { $errorReason = elgg_echo('izap_videos:fileNotFound'); } $adminGuid = izapGetSiteAdmin_izap_videos(true); // notify admin notify_user($adminGuid, elgg_get_site_entity()->getGUID(), elgg_echo('izap_videos:notifySub:videoNotConverted'), elgg_echo('izap_videos:notifyAdminMsg:videoNotConverted', array($errorReason))); if (!empty($errorReason)) { $return = array('error' => true, 'reason' => $errorReason); } return $return; }
/** * Main function that register everything */ function init_izap_videos() { elgg_extend_view('css/elgg', 'izap_videos/css'); elgg_extend_view('css/admin', 'izap_videos/css'); // Register the main lib $base_dir = elgg_get_plugins_path() . 'izap_videos/lib'; elgg_register_library('izap_videos:core', "{$base_dir}/izapLib.php"); elgg_load_library('izap_videos:core'); // Load all the required libraries izapLoadLib_izap_videos(); elgg_register_ajax_view('izap_videos/admin/getQueue'); elgg_register_ajax_view('izap_videos/playpopup'); // Set up the site menu elgg_register_menu_item('site', array('name' => 'videos', 'href' => 'videos/all', 'text' => elgg_echo('videos'))); // Add admin menu item elgg_register_admin_menu_item('administer', 'izap_videos', 'administer_utilities'); // Add link to owner block elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'izap_videos_owner_block_menu'); // Register for the entity menu elgg_register_plugin_hook_handler('register', 'menu:entity', 'izap_videos_entity_menu_setup'); // Register pagehandler elgg_register_page_handler('videos', 'izap_videos_pagehandler'); elgg_register_page_handler('izap_videos_files', 'izap_videos_files_pagehandler'); // Register url handler elgg_register_plugin_hook_handler('entity:url', 'object', 'izap_videos_urlhandler'); // Register a plugin hook to allow custom river view for comments made on videos elgg_register_plugin_hook_handler('view', 'river/object/comment/create', 'izap_videos_river_comment'); // Register notification hook elgg_register_notification_event('object', 'izap_videos', array('create')); elgg_register_plugin_hook_handler('prepare', 'notification:create:object:izap_videos', 'izap_videos_notify_message'); $period = izapAdminSettings_izap_videos('izap_cron_time'); if ($period != 'none') { elgg_register_plugin_hook_handler('cron', $period, 'izap_queue_cron'); } // Group videos add_group_tool_option('izap_videos', elgg_echo('izap_videos:group:enablevideo'), true); elgg_extend_view('groups/tool_latest', 'izap_videos/group_module'); // Adding izap_videos widget elgg_register_widget_type('izap_videos', elgg_echo('izap_videos:videos'), elgg_echo('izap_videos:widget')); if (elgg_is_active_plugin('widget_manager')) { //add index widget for Widget Manager plugin elgg_register_widget_type('index_latest_videos', elgg_echo("izap_videos:mostrecent"), elgg_echo('izap_videos:mostrecent:description'), array("index")); //add groups widget for Widget Manager plugin elgg_register_widget_type('groups_latest_videos', elgg_echo("izap_videos:mostrecent"), elgg_echo('izap_videos:mostrecent:group:description'), array("groups")); //register title urls for widgets elgg_register_plugin_hook_handler("entity:url", "object", "izap_videos_widget_urls"); } // Allow liking of videos elgg_register_plugin_hook_handler('likes:is_likable', 'object:izap_videos', 'Elgg\\Values::getTrue'); // Register for search elgg_register_entity_type('object', 'izap_videos'); // Register some actions $action_path = elgg_get_plugins_path() . 'izap_videos/actions/izap_videos'; elgg_register_action('izap_videos/admin/settings', "{$action_path}/admin/settings.php", 'admin'); elgg_register_action('izap_videos/admin/api_keys', "{$action_path}/admin/api_keys.php", 'admin'); elgg_register_action('izap_videos/admin/resetSettings', "{$action_path}/admin/resetSettings.php", 'admin'); elgg_register_action('izap_videos/admin/recycle', "{$action_path}/admin/recycle.php", 'admin'); elgg_register_action('izap_videos/admin/recycle_delete', "{$action_path}/admin/recycle_delete.php", 'admin'); elgg_register_action('izap_videos/admin/reset', "{$action_path}/admin/reset.php", 'admin'); elgg_register_action('izap_videos/admin/upgrade', "{$action_path}/admin/upgrade.php", 'admin'); elgg_register_action('izap_videos/addEdit', "{$action_path}/addEdit.php", 'logged_in'); elgg_register_action('izap_videos/delete', "{$action_path}/delete.php", 'logged_in'); elgg_register_action('izap_videos/favorite_video', "{$action_path}/favorite_video.php", 'logged_in'); }
<?php echo elgg_view('input/checkboxes', array('internalname' => 'izap[izapIndexPageWidget]', 'options' => array(elgg_echo('izap_videos:adminSettings:addOnHomePage') => 'YES'), 'value' => izapAdminSettings_izap_videos('izapIndexPageWidget', 'YES', FALSE, TRUE))); ?> </label> </p> <p> <label> <?php echo elgg_echo('izap_videos:adminSettings:izapGiveUsCredit'); ?> <br /> <?php echo elgg_view('input/checkboxes', array('internalname' => 'izap[izapGiveUsCredit]', 'options' => array(elgg_echo('izap_videos:adminSettings:giveUsCredit') => 'YES'), 'value' => izapAdminSettings_izap_videos('izapGiveUsCredit', 'YES', FALSE, TRUE))); ?> </label> <span class="izap_info_text"> <?php echo elgg_echo('izap_videos:adminSettings:info:give-credit'); ?> </span> </p> <?php echo elgg_view('input/securitytoken'); echo elgg_view('input/submit', array('value' => elgg_echo('izap_videos:adminSettings:save'))); ?> </form>
/** * Resets queue * * @return boolean */ function izapResetQueue_izap_videos() { return izapAdminSettings_izap_videos('isQueueRunning', 'no', true); }
/** * gets the video player according to the video type * * @param int $width width of video player * @param int $height height of video player * @param int $autoPlay autoplay option (1 | 0) * @param string $extraOptions extra options if available * @return HTML complete player code */ public function getPlayer($width = 670, $height = 400, $autoPlay = 0, $extraOptions = '') { global $CONFIG; $html = ''; if (filter_var($this->videosrc, FILTER_VALIDATE_URL)) { switch ($this->videotype) { case 'youtube': $html = "<object width=\"{$width}\" height=\"{$height}\"><param name=\"movie\" value=\"{$this->videosrc}&hl=en&fs=1&autoplay={$autoPlay}\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"{$this->videosrc}&hl=en&fs=1&autoplay={$autoPlay} \" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\"></embed></object>"; break; case 'vimeo': $html = "<object width=\"{$width}\" height=\"{$height}\"><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"{$this->videosrc}&autoplay={$autoPlay}\" /><embed src=\"{$this->videosrc}&autoplay={$autoPlay}\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\"></embed></object>"; break; case 'veoh': $html = "<embed src=\"{$this->videosrc}&videoAutoPlay={$autoPlay}\" allowFullScreen=\"true\" width=\"{$width}\" height=\"{$height}\" bgcolor=\"#FFFFFF\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\"></embed>"; break; case 'uploaded': if ($this->converted == 'yes') { $border_color1 = izapAdminSettings_izap_videos('izapBorderColor1'); $border_color2 = izapAdminSettings_izap_videos('izapBorderColor2'); $border_color3 = izapAdminSettings_izap_videos('izapBorderColor3'); if (!empty($border_color3)) { $extraOptions .= '&btncolor=0x' . $border_color3; } if (!empty($border_color1)) { $extraOptions .= '&accentcolor=0x' . $border_color1; } if (!empty($border_color2)) { $extraOptions .= '&txtcolor=0x' . $border_color2; } $html = "\r\n <object width='" . $width . "' height='" . $height . "' id='flvPlayer'>\r\n <param name='allowFullScreen' value='true'>\r\n <param name='allowScriptAccess' value='always'>\r\n <param name='movie' value='" . $this->IZAPSETTINGS->playerPath . "?movie=" . $this->videosrc . $extraOptions . "&volume=30&autoload=on&autoplay=on&vTitle=" . $this->title . "&showTitle=yes' >\r\n <embed src='" . $this->IZAPSETTINGS->playerPath . "?movie=" . $this->videosrc . $extraOptions . "&volume=30&autoload=on&autoplay=on&vTitle=" . $this->title . "&showTitle=yes' width='" . $width . "' height='" . $height . "' allowFullScreen='true' type='application/x-shockwave-flash' allowScriptAccess='always' wmode='transparent'>\r\n </object>"; } else { $html = elgg_echo('izap_videos:processed'); } break; case 'embed': case 'others': $html = izapGetReplacedHeightWidth_izap_videos($height, $width, $this->videosrc); break; } } else { $html = izapGetReplacedHeightWidth_izap_videos($height, $width, $this->videosrc); } return $html; }
/** * Gets the video player according to the video type * * @param int $width width of video player * @param int $height height of video player * @param int $autoPlay autoplay option (1 | 0) * @param string $extraOptions extra options if available * @return HTML complete player code */ public function getPlayer($width = 600, $height = 360, $autoPlay = 0, $extraOptions = '') { $html = ''; switch ($this->videotype) { case 'youtube': $html = "<iframe src=\"{$this->videosrc}?rel=0&autoplay={$autoPlay}\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"; break; case 'vimeo': $html = "<iframe src=\"{$this->videosrc}&autoplay={$autoPlay}\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"; break; case 'dailymotion': $html = "<iframe src=\"{$this->videosrc}?autoplay={$autoPlay}\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"; break; case 'uploaded': if ($this->converted == 'yes') { $border_color1 = izapAdminSettings_izap_videos('izapBorderColor1'); $border_color2 = izapAdminSettings_izap_videos('izapBorderColor2'); $border_color3 = izapAdminSettings_izap_videos('izapBorderColor3'); if (!empty($border_color3)) { $extraOptions .= '&btncolor=0x' . $border_color3; } if (!empty($border_color1)) { $extraOptions .= '&accentcolor=0x' . $border_color1; } if (!empty($border_color2)) { $extraOptions .= '&txtcolor=0x' . $border_color2; } $html = "\r\n<object width='" . $width . "' height='" . $height . "' id='flvPlayer'>\r\n<param name='allowFullScreen' value='true'>\r\n<param name='allowScriptAccess' value='always'>\r\n<param name='movie' value='" . $this->IZAPSETTINGS->playerPath . "?movie=" . $this->videosrc . $extraOptions . "&volume=30&autoload=on&autoplay=off&vTitle=" . $this->title . "&showTitle=yes' >\r\n<embed src='" . $this->IZAPSETTINGS->playerPath . "?movie=" . $this->videosrc . $extraOptions . "&volume=30&autoload=on&autoplay=off&vTitle=" . $this->title . "&showTitle=yes' width='" . $width . "' height='" . $height . "' allowFullScreen='true' type='application/x-shockwave-flash' allowScriptAccess='always' wmode='transparent'>\r\n</object>"; } else { $html = elgg_echo('izap_videos:processed'); } break; case 'embed': $html = izapGetReplacedHeightWidth_izap_videos($height, $width, $this->videosrc); break; } return $html; }
*/ // get the video id as input $video = (int) get_input('guid'); $izap_videos = izapVideoCheck_izap_videos($video); // make the video owner page owner set_page_owner($izap_videos->container_guid); $title = $izap_videos->title; // get page contents $video = elgg_view_entity($izap_videos, TRUE); $area2 .= elgg_view('izap_videos/izapLink'); // get tags and categories if ($izap_videos->converted == 'yes') { $share .= elgg_view('izap_videos/video/elements/share', array('video' => $izap_videos)); } $area3 = elgg_view('izap_videos/video/elements/related', array('video' => $izap_videos)); $layout = izapAdminSettings_izap_videos('izap_display_page'); switch ($layout) { case 'default': $body = elgg_view_layout("izap_videos_main_page", $share, $video . $area2, $area3); break; case 'left': $body = elgg_view_layout("izap_videos_main_page_leftbar", $share, $video . $area2, $area3); break; case 'full': $video = elgg_view_title($izap_videos->title); $video .= $Add; $video .= elgg_view('izap_videos/video/elements/video', array('video' => $izap_videos, 'height' => 500, 'width' => 800)); $content .= '<br />' . elgg_view('izap_videos/video/elements/description', array('video' => $izap_videos)); if ($izap_videos->converted == 'yes') { $content .= elgg_view('izap_videos/video/elements/comments', array('video' => $izap_videos)); }
$form .= "</div>"; $form .= "<div>"; $form .= "<label>" . elgg_echo('izap_videos:adminSettings:izapBorderColor2') . "</label><br>"; $form .= elgg_view('input/text', array('name' => 'izap[izapBorderColor2]', 'value' => izapAdminSettings_izap_videos('izapBorderColor2', 'FFFFFF'))); $form .= elgg_view("output/longtext", array("value" => elgg_echo('izap_videos:adminSettings:info:bg-color'), 'class' => 'elgg-subtext')); $form .= "</div>"; $form .= "<div class='mbl'>"; $form .= "<label>" . elgg_echo('izap_videos:adminSettings:izapBorderColor3') . "</label><br>"; $form .= elgg_view('input/text', array('name' => 'izap[izapBorderColor3]', 'value' => izapAdminSettings_izap_videos('izapBorderColor3', 'FFFFFF'))); $form .= elgg_view("output/longtext", array("value" => elgg_echo('izap_videos:adminSettings:info:bg-color'), 'class' => 'elgg-subtext')); $form .= "</div>"; $form .= "<div class='mbm'>"; $form .= "<label>" . elgg_echo('izap_videos:adminSettings:izap_cron_time') . "</label><br>"; $form .= elgg_view('input/select', array('name' => 'izap[izap_cron_time]', 'options_values' => array('minute' => elgg_echo('izap_videos:adminSettings:minute'), 'fiveminute' => elgg_echo('izap_videos:adminSettings:fiveminute'), 'fifteenmin' => elgg_echo('izap_videos:adminSettings:fifteenmin'), 'halfhour' => elgg_echo('izap_videos:adminSettings:halfhour'), 'hourly' => elgg_echo('izap_videos:adminSettings:hourly'), 'none' => elgg_echo('izap_videos:adminSettings:cron_off')), 'value' => izapAdminSettings_izap_videos('izap_cron_time', 'minute', false))); $form .= elgg_view("output/longtext", array("value" => elgg_echo('izap_videos:adminSettings:info:izap_cron_time'), 'class' => 'elgg-subtext')); $form .= "</div>"; $form .= "<div class='mbm'>"; $form .= "<label>" . elgg_echo('izap_videos:adminSettings:izapMaxFileSize') . "</label><br>"; $form .= elgg_view('input/text', array('name' => 'izap[izapMaxFileSize]', 'value' => izapAdminSettings_izap_videos('izapMaxFileSize', '5'))); $form .= "</div>"; $form .= "<div class='mbm'>"; $form .= "<label>" . elgg_echo('izap_videos:adminSettings:izapKeepOriginal') . "</label><br>"; $form .= elgg_view('input/checkboxes', array('name' => 'izap[izapKeepOriginal]', 'options' => array(elgg_echo('izap_videos:adminSettings:keep-original') => 'YES'), 'value' => izapAdminSettings_izap_videos('izapKeepOriginal', 'YES', false, true))); $form .= elgg_view("output/longtext", array("value" => elgg_echo('izap_videos:adminSettings:info:izapKeepOriginal'), 'class' => 'elgg-subtext')); $form .= "</div>"; $form .= "<div class='mbl'>"; $form .= "<label>" . elgg_echo('izap_videos:adminSettings:izap_river_thumbnails') . "</label><br>"; $form .= elgg_view('input/select', array('name' => 'izap[izap_river_thumbnails]', 'options_values' => array('small' => elgg_echo('izap_videos:adminSettings:thumbnails_small'), 'medium' => elgg_echo('izap_videos:adminSettings:thumbnails_medium'), 'large' => elgg_echo('izap_videos:adminSettings:thumbnails_large'), 'none' => elgg_echo('izap_videos:adminSettings:thumbnails_none')), 'value' => izapAdminSettings_izap_videos('izap_river_thumbnails', 'medium', false))); $form .= "</div>"; $form .= elgg_view('input/submit', array('value' => elgg_echo('izap_videos:adminSettings:save'))); echo $form;
* Original developer of the iZAP Videos plugin: * @package Elgg videotizer, by iZAP Web Solutions * @license GNU Public License version 2 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ $postedArray = get_input('izap'); $plugin = elgg_get_plugin_from_id('izap_videos'); $videoOptions = filter_tags($_POST['izap']['izapVideoOptions']); if (empty($videoOptions)) { register_error(elgg_echo('izap_videos:error:videoOptionBlank')); forward(REFERER); } $postedArray['izapVideoOptions'] = $videoOptions; if (!empty($postedArray['izapKeepOriginal'])) { $postedArray['izapKeepOriginal'] = 'YES'; } else { $postedArray['izapKeepOriginal'] = 'NO'; } foreach ($postedArray as $key => $values) { izapAdminSettings_izap_videos($key, $values, true); if ($key == 'izapVideoOptions') { if (in_array('ONSERVER', $values)) { $queue_object = new izapQueue(); } } } system_message(elgg_echo('izap_videos:success:adminSettingsSaved')); forward(REFERER);