Exemplo n.º 1
0
 /**
  * Given the current wizard state, determines the next state.
  */
 public function processState()
 {
     $state = $_POST[LONGTAIL_KEY . "state"];
     if (isset($_POST["breadcrumb"]) && !empty($_POST["breadcrumb"])) {
         $state = $_POST["breadcrumb"];
     }
     switch ($state) {
         case BasicState::getID():
             $state = new BasicState($_POST[LONGTAIL_KEY . "config"]);
             break;
         case AdvancedState::getID():
             $state = new AdvancedState($_POST[LONGTAIL_KEY . "config"]);
             break;
         case LTASState::getID():
             $state = new LTASState($_POST[LONGTAIL_KEY . "config"]);
             break;
         case PluginState::getID():
             $state = new PluginState($_POST[LONGTAIL_KEY . "config"]);
             break;
         default:
             $state = new PlayerState($_POST[LONGTAIL_KEY . "config"]);
             break;
     }
     $this->processPost($state);
 }
Exemplo n.º 2
0
 protected function getBreadcrumbBar(&$form, $form_state)
 {
     $form["Breadcrumbs"] = array("#prefix" => "<div id='breadcrumbs'>", "#suffix" => "</div>");
     $form["Breadcrumbs"][LONGTAIL_KEY . BasicState::getID()] = array("#type" => "radio", "#id" => LONGTAIL_KEY . BasicState::getID(), "#printed" => true, "#name" => "breadcrumb", "#title" => BasicState::getTitle(), "#return_value" => BasicState::getID(), "#default_value" => $this->getID());
     $form["Breadcrumbs"][LONGTAIL_KEY . AdvancedState::getID()] = array("#type" => "radio", "#id" => LONGTAIL_KEY . AdvancedState::getID(), "#name" => "breadcrumb", "#title" => AdvancedState::getTitle(), "#return_value" => AdvancedState::getID(), "#default_value" => $this->getID());
     $form["Breadcrumbs"][LONGTAIL_KEY . LTASState::getID()] = array("#type" => "radio", "#id" => LONGTAIL_KEY . LTASState::getID(), "#name" => "breadcrumb", "#title" => LTASState::getTitle(), "#return_value" => LTASState::getID(), "#default_value" => $this->getID());
     $form["Breadcrumbs"][LONGTAIL_KEY . PluginState::getID()] = array("#type" => "radio", "#id" => LONGTAIL_KEY . PluginState::getID(), "#name" => "breadcrumb", "#title" => PluginState::getTitle(), "#return_value" => PluginState::getID(), "#default_value" => $this->getID());
 }
Exemplo n.º 3
0
 /**
  * @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());
 }
Exemplo n.º 4
0
    /**
     * @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 
    }
Exemplo n.º 5
0
    protected function getBreadcrumbBar()
    {
        ?>
    <script type="text/javascript">
      jQuery(function() {
        jQuery("#breadcrumbs").buttonset();
      });
    </script>
    <div id="breadcrumbs" style="padding: 14px 15px 3px 0;">
      <input type="radio" id="<?php 
        echo LONGTAIL_KEY . BasicState::getID();
        ?>
" name="breadcrumb" <?php 
        checked(BasicState::getID(), $this->getID());
        ?>
 value="<?php 
        echo BasicState::getID();
        ?>
" onchange="form.submit();"/>
      <label for="<?php 
        echo LONGTAIL_KEY . BasicState::getID();
        ?>
">
        <?php 
        echo BasicState::getTitle();
        ?>
      </label>
      <input type="radio" id="<?php 
        echo LONGTAIL_KEY . AdvancedState::getID();
        ?>
" name="breadcrumb" <?php 
        checked(AdvancedState::getID(), $this->getID());
        ?>
 value="<?php 
        echo AdvancedState::getID();
        ?>
" onchange="form.submit();" />
      <label for="<?php 
        echo LONGTAIL_KEY . AdvancedState::getID();
        ?>
">
        <?php 
        echo AdvancedState::getTitle();
        ?>
      </label>
      <input type="radio" id="<?php 
        echo LONGTAIL_KEY . LTASState::getID();
        ?>
" name="breadcrumb" <?php 
        checked(LTASState::getID(), $this->getID());
        ?>
 value="<?php 
        echo LTASState::getID();
        ?>
" onchange="form.submit();" />
      <label for="<?php 
        echo LONGTAIL_KEY . LTASState::getID();
        ?>
">
        <?php 
        echo LTASState::getTitle();
        ?>
      </label>
      <input type="radio" id="<?php 
        echo LONGTAIL_KEY . PluginState::getID();
        ?>
" name="breadcrumb" <?php 
        checked(PluginState::getID(), $this->getID());
        ?>
 value="<?php 
        echo PluginState::getID();
        ?>
" onchange="form.submit();" />
      <label for="<?php 
        echo LONGTAIL_KEY . PluginState::getID();
        ?>
">
        <?php 
        echo PluginState::getTitle();
        ?>
      </label>
    </div>
  <?php 
    }