/** * @see AdminState::render() * @param $form * @param $form_state */ public function render(&$form, $form_state) { $flash_vars = LongTailFramework::getPlayerFlashVars($this->flashVarCat()); parent::getBreadcrumbBar($form, $form_state); $this->selectedPlayer($form, $form_state); $this->getHeader(); foreach (array_keys($flash_vars) as $groups) { $form[$groups] = array("#type" => "fieldset", "#title" => $groups); foreach ($flash_vars[$groups] as $fvar) { $name = LONGTAIL_KEY . "player_" . $fvar->getName(); $value = $form_state["storage"][$name] ? $form_state["storage"][$name] : $fvar->getDefaultValue(); $form[$groups][$name] = array("#title" => $fvar->getName(), "#description" => $fvar->getDescription(), "#default_value" => $value); if ($fvar->getType() == FlashVar::SELECT) { $form[$groups][$name]["#type"] = "select"; $options = array(); foreach ($fvar->getValues() as $val) { $options[$val] = $val; } $form[$groups][$name]["#options"] = $options; } else { $form[$groups][$name]["#type"] = "textfield"; } } } $this->getFooter($form, $form_state); $this->getButtonBar($form, false); }
/** * @see AdminState::render() * @param $form * @param $form_state */ public function render(&$form, $form_state) { $ltas = LongTailFramework::getLTASConfig(); parent::getBreadcrumbBar($form, $form_state); $this->selectedPlayer($form, $form_state); $form["LTAS"] = array("#type" => "fieldset", "#title" => t("LongTail AdSolution Settings")); $value = $form_state["storage"][LONGTAIL_KEY . "plugin_ltas_enable"] ? $form_state["storage"][LONGTAIL_KEY . "plugin_ltas_enable"] : $ltas["enabled"]; $form["LTAS"][LONGTAIL_KEY . "plugin_ltas_enable"] = array("#type" => "checkbox", "#name" => LONGTAIL_KEY . "plugin_ltas_enable", "#title" => t("Enable LongTail AdSolution"), "#default_value" => $value); $form["LTAS"]["description"] = array("#type" => "item", "#description" => JW_PLAYER_LTAS_DESC); $value = $_POST[LONGTAIL_KEY . "plugin_ltas_cc"] ? $_POST[LONGTAIL_KEY . "plugin_ltas_cc"] : $ltas["channel_code"]; $form["LTAS"][LONGTAIL_KEY . "plugin_ltas_cc"] = array("#type" => "textfield", "#name" => LONGTAIL_KEY . "plugin_ltas_cc", "#title" => t("ltas.cc"), "#default_value" => $value, "#description" => "Your LTAS channel code. Obtained from the <a href=https://dashboard.longtailvideo.com/" . JW_PLAYER_GA_VARS . " target=_blank>AdSolution Dashboard.</a>"); $this->buttonBar($form, LTASState::getID()); }
/** * @see AdminState::render() * @param $form * @param $form_state */ public function render(&$form, $form_state) { $plugins = LongTailFramework::getPlugins(); parent::getBreadcrumbBar($form, $form_state); $this->selectedPlayer($form, $form_state); $id = LONGTAIL_KEY . "plugin_selector"; $form["JWPlugins"] = array("#prefix" => "<div>", "#suffix" => "</div>"); $form["JWPlugins"][$id] = array(); $form["JWPlugins"][$id]["tab"] = array("#id" => "{$id}" . "_tab", "#type" => "item", "#value" => "<a href='#{$id}'>Plugin Selector</a>"); foreach ($plugins as $plugin) { $id = LONGTAIL_KEY . "plugin_" . $plugin->getRepository(); $form["JWPlugins"][$id] = array(); $form["JWPlugins"][$id]["tab"] = array("#id" => "{$id}" . "_tab", "#type" => "item", "#value" => "<a href='#{$id}'>" . $plugin->getTitle() . "</a>"); } $id = LONGTAIL_KEY . "plugin_selector"; $form["JWPlugins"][$id]["body"] = array(); foreach ($plugins as $plugin) { $name = LONGTAIL_KEY . "plugin_" . $plugin->getRepository() . "_" . "enable"; $value = $form_state["storage"][$name] ? $form_state["storage"][$name] : $plugin->isEnabled(); $form["JWPlugins"][$id]["body"][$name] = array("#type" => "checkbox", "#title" => "Enable " . $plugin->getTitle(), "#description" => $plugin->getDescription(), "#name" => $name, "#default_value" => $value); } foreach ($plugins as $plugin) { $id = LONGTAIL_KEY . "plugin_" . $plugin->getRepository(); $form["JWPlugins"][$id]["body"] = array(); foreach (array_keys($plugin->getFlashVars()) as $plugin_flash_vars) { $p_vars = $plugin->getFlashVars(); foreach ($p_vars[$plugin_flash_vars] as $plugin_flash_var) { $name = LONGTAIL_KEY . "plugin_" . $plugin->getPluginPrefix() . "_" . $plugin_flash_var->getName(); $value = $form_state["storage"][$name] ? $form_state["storage"][$name] : $plugin_flash_var->getDefaultValue(); $form["JWPlugins"][$id]["body"][$name] = array("#title" => $plugin->getPluginPrefix() . "." . $plugin_flash_var->getName(), "#description" => $plugin_flash_var->getDescription(), "#default_value" => $value); if ($plugin_flash_var->getType() == FlashVar::SELECT) { $form["JWPlugins"][$id]["body"][$name]["#type"] = "select"; $options = array(); foreach ($plugin_flash_var->getValues() as $val) { $options[$val] = $val; } $form["JWPlugins"][$id]["body"][$name]["#options"] = $options; } else { $form["JWPlugins"][$id]["body"][$name]["#type"] = "textfield"; } } } } drupal_add_js($this->generateScript($plugins), "inline"); $this->buttonBar($form, PluginState::getID(), true, false); }
/** * @see AdminState::render() */ public function render() { $plugins = LongTailFramework::getPlugins(); $configValues = LongTailFramework::getConfigValues(); $pluginString = explode(",", $configValues["plugins"]); $pluginList = array(); foreach ($pluginString as $pluginStr) { $pluginList[$pluginStr] = $pluginStr; } ?> <div class="wrap"> <script type="text/javascript"> jQuery(function () { jQuery('#tabs').tabs(); removeAllTabs(); jQuery("<?php echo "#" . LONGTAIL_KEY . "plugin_selector_tab"; ?> ").css("display", "block"); <?php foreach ($plugins as $plugin) { ?> <?php if ($plugin->isEnabled()) { ?> jQuery("<?php echo "#" . LONGTAIL_KEY . "plugin_" . $plugin->getRepository() . "_tab"; ?> ").css("display", "block"); <?php } ?> <?php } ?> jQuery("#tabs").css("display", "block"); jQuery(":checkbox").change(function() { var name = "#" + jQuery(this)[0].name.replace("enable", "tab"); var hidden = jQuery(this)[0].name + "_hidden"; if(jQuery(this)[0].checked) { jQuery(name).css("display", "block"); jQuery(name).val(true); } else { jQuery(name).css("display", "none"); jQuery(name).val(false); } }) }); function removeAllTabs() { jQuery("#tabNavigation").children().css("display","none"); } </script> <form name="<?php echo LONGTAIL_KEY . "form"; ?> " method="post" action=""> <?php parent::getBreadcrumbBar(); ?> <?php $this->selectedPlayer(); ?> <p/> <div id="tabs"> <ul id="tabNavigation"> <?php $id = LONGTAIL_KEY . "plugin_selector"; ?> <li id="<?php echo $id . "_tab"; ?> "><a href="<?php echo "#" . $id; ?> ">Plugin Selector</a></li> <?php foreach ($plugins as $plugin) { ?> <?php $id = LONGTAIL_KEY . "plugin_" . $plugin->getRepository(); ?> <li id="<?php echo $id . "_tab"; ?> "><a href="<?php echo "#" . $id; ?> "><?php echo $plugin->getTitle(); ?> </a></li> <?php } ?> </ul> <div id="<?php echo LONGTAIL_KEY . "plugin_selector"; ?> "> <table class="form-table"> <?php foreach ($plugins as $plugin) { ?> <?php $name = LONGTAIL_KEY . "plugin_" . $plugin->getRepository() . "_" . "enable"; ?> <?php $value = isset($_POST[$name]) ? $_POST[$name] : $plugin->isEnabled(); ?> <?php unset($_POST[$name]); ?> <tr valign="top"> <th>Enable <?php echo $plugin->getTitle(); ?> :</th> <td> <input name="<?php echo $name; ?> " type="checkbox" value="1" <?php checked(true, $value); ?> /> <input name="<?php echo $name . "_hidden"; ?> " type="hidden" value="0"/> <span class="description"><?php echo $plugin->getDescription() . " <a href=" . $plugin->getPage() . JW_PLAYER_GA_VARS . " target=_blank>Learn more...</a>"; ?> </span> </td> </tr> <tr> <td colspan="2"></td> </tr> <?php } ?> </table> </div> <?php foreach ($plugins as $plugin) { ?> <?php unset($pluginList[$plugin->getRepository()]); ?> <div id="<?php echo LONGTAIL_KEY . "plugin_" . $plugin->getRepository(); ?> "> <table class="form-table"> <?php foreach (array_keys($plugin->getFlashVars()) as $plugin_flash_vars) { ?> <?php $p_vars = $plugin->getFlashVars(); ?> <?php foreach ($p_vars[$plugin_flash_vars] as $plugin_flash_var) { ?> <tr valign="top"> <?php $name = LONGTAIL_KEY . "plugin_" . $plugin->getPluginPrefix() . "_" . $plugin_flash_var->getName(); ?> <?php $value = isset($_POST[$name]) ? $_POST[$name] : $plugin_flash_var->getDefaultValue(); ?> <?php unset($_POST[$name]); ?> <th><?php echo $plugin->getPluginPrefix() . "." . $plugin_flash_var->getName(); ?> :</th> <td> <?php if ($plugin_flash_var->getType() == FlashVar::SELECT) { ?> <select size="1" name="<?php echo $name; ?> "> <?php foreach ($plugin_flash_var->getValues() as $val) { ?> <option value="<?php echo $val; ?> " <?php selected($val, $value); ?> > <?php echo htmlentities($val); ?> </option> <?php } ?> </select> <?php } else { ?> <input type="text" value="<?php echo $value; ?> " name="<?php echo $name; ?> " /> <?php } ?> <span class="description"><?php echo $plugin_flash_var->getDescription(); ?> </span> </td> </tr> <?php } ?> <?php } ?> </table> </div> <?php } ?> </div> <?php $this->getFooter($pluginList); ?> <?php $this->buttonBar(PluginState::getID(), true, false); ?> </form> </div> <?php }
/** * @see AdminState::render() */ public function render() { $ltas = LongTailFramework::getLTASConfig(); ?> <div class="wrap"> <form name="<?php echo LONGTAIL_KEY . "form"; ?> " method="post" action=""> <?php parent::getBreadcrumbBar(); ?> <?php $this->selectedPlayer(); ?> <p/> <div id="poststuff"> <div id="post-body"> <div id="post-body-content"> <div class="stuffbox"> <h3 class="hndle"><span><?php echo "LongTail AdSolution Settings"; ?> </span></h3> <div class="inside" style="margin: 15px;"> <table class="form-table"> <tr> <?php $value = isset($_POST["jwplayermodule_plugin_ltas_enable"]) ? $_POST["jwplayermodule_plugin_ltas_enable"] : isset($ltas["enabled"]) ? $ltas["enabled"] : false; ?> <?php unset($_POST["jwplayermodule_plugin_ltas_enable"]); ?> <td><input name="jwplayermodule_plugin_ltas_enable" type="checkbox" value="1" <?php checked(true, $value); ?> /> <span>Enable LongTail AdSolution</span> </td> </tr> <tr> <td colspan="2"><span class="description"><?php echo JW_PLAYER_LTAS_DESC; ?> </span></td> </tr> <tr> <?php $value = isset($_POST["jwplayermodule_plugin_ltas_cc"]) ? $_POST["jwplayermodule_plugin_ltas_cc"] : $ltas["channel_code"]; ?> <?php unset($_POST["jwplayermodule_plugin_ltas_cc"]); ?> <th>ltas.cc</th> <td> <input type="text" value="<?php echo $value; ?> " name="jwplayermodule_plugin_ltas_cc" /> <span class="description"><?php echo "Your LTAS channel code. Obtained from the <a href=https://dashboard.longtailvideo.com/" . JW_PLAYER_GA_VARS . " target=_blank>AdSolution Dashboard.</a>"; ?> </span> </td> </tr> </table> </div> </div> </div> </div> </div> <?php $this->buttonBar(LTASState::getID()); ?> </form> </div> <?php }
/** * @see AdminState::render() */ public function render() { $flash_vars = LongTailFramework::getPlayerFlashVars($this->flashVarCat()); ?> <div class="wrap"> <form name="<?php echo LONGTAIL_KEY . "form"; ?> " method="post" action=""> <?php parent::getBreadcrumbBar(); ?> <?php $this->selectedPlayer(); ?> <p/> <div id="poststuff"> <div id="post-body"> <div id="post-body-content"> <?php $this->getHeader(); ?> <?php foreach (array_keys($flash_vars) as $groups) { ?> <div class="stuffbox"> <h3 class="hndle"><span><?php echo $groups; ?> </span></h3> <div class="inside" style="margin: 15px;"> <table class="form-table"> <?php foreach ($flash_vars[$groups] as $fvar) { ?> <tr valign="top"> <th><?php echo $fvar->getName(); ?> :</th> <td> <?php $name = LONGTAIL_KEY . "player_" . $fvar->getName(); ?> <?php $value = $_POST[$name] ? $_POST[$name] : $fvar->getDefaultValue(); ?> <?php unset($_POST[$name]); ?> <?php if ($fvar->getType() == FlashVar::SELECT) { ?> <select size="1" name="<?php echo $name; ?> "> <?php foreach ($fvar->getValues() as $val) { ?> <option value="<?php echo $val; ?> " <?php selected($val, $value); ?> > <?php echo htmlentities($val); ?> </option> <?php } ?> </select> <?php } else { ?> <input type="text" value="<?php echo $value; ?> " name="<?php echo $name; ?> " /> <?php } ?> <span class="description"><?php echo $fvar->getDescription(); ?> </span> </td> </tr> <?php } ?> </table> </div> </div> <?php } ?> <?php $this->getFooter(); ?> </div> </div> </div> <?php $this->getButtonBar(false); ?> </form> </div> <?php }