public function dispatchAction($action)
 {
     $this->action = $action;
     //----------------------------------------------------------------
     //------  VIEW RSS ACTIONS
     if ($action == ViewAboutPageAction::getActionName()) {
         $implAction = new ViewAboutPageAction();
         //
     } else {
         if ($action == ViewBookmarksPageAction::getActionName()) {
             $implAction = new ViewBookmarksPageAction();
             //
         } else {
             if ($action == ViewHomePageAction::getActionName()) {
                 $implAction = new ViewHomePageAction();
                 //
             } else {
                 if ($action == ViewPlaylistPageAction::getActionName()) {
                     $implAction = new ViewPlaylistPageAction();
                     //
                 } else {
                     if ($action == ViewSetupPageAction::getActionName()) {
                         $implAction = new ViewSetupPageAction();
                         //
                     } else {
                         if ($action == ViewWebsitesPageAction::getActionName()) {
                             $implAction = new ViewWebsitesPageAction();
                             //
                             //
                             //----- VIEW WEB ACTIONS --------------------------------------
                         } else {
                             if ($action == ViewWebHomePageAction::getActionName()) {
                                 $implAction = new ViewWebHomePageAction();
                                 //
                             } else {
                                 if ($action == ViewPlaylistWebPageAction::getActionName()) {
                                     $implAction = new ViewPlaylistWebPageAction();
                                     //
                                 } else {
                                     if ($action == ViewScraperMegavideoPageAction::getActionName()) {
                                         $implAction = new ViewScraperMegavideoPageAction();
                                         //
                                     } else {
                                         if ($action == SetupXvodPageAction::getActionName()) {
                                             $implAction = new SetupXvodPageAction();
                                             //
                                         } else {
                                             if ($action == ViewScraperPageAction::getActionName()) {
                                                 $implAction = new ViewScraperPageAction();
                                                 //
                                             } else {
                                                 if ($action == ViewCookiePageAction::getActionName()) {
                                                     $implAction = new ViewCookiePageAction();
                                                     //
                                                 } else {
                                                     if ($action == ViewFavouritePageAction::getActionName()) {
                                                         $implAction = new ViewFavouritePageAction();
                                                         //
                                                     } else {
                                                         if ($action == ViewInformationPageAction::getActionName()) {
                                                             $implAction = new ViewInformationPageAction();
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     //----------------------------------------------------------------
     //------  NON VIEW RSS ACTIONS
     if (!$implAction) {
         if ($action == SaveBookmarkAction::getActionName()) {
             $implAction = new SaveBookmarkAction();
             //
         } else {
             if ($action == DeleteBookmarkAction::getActionName()) {
                 $implAction = new DeleteBookmarkAction();
                 //
             } else {
                 if ($action == SaveFavouriteWebsiteAction::getActionName()) {
                     $implAction = new SaveFavouriteWebsiteAction();
                     //
                 }
             }
         }
     }
     //----------------------------------------------------------------
     //Execute action
     if ($implAction) {
         $implAction->dispatch();
     } else {
     }
 }
    public function showBodyContent()
    {
        $megavideoScraper = "index.php?web&action=" . ViewScraperMegavideoPageAction::getActionName() . "&PHPSEDID=" . session_id();
        echo '<h3 style="margin-bottom:10px;">Add Megavideo Link</h3>' . "\n";
        echo '<table class="linkTable">
                <tr>
                    <td width="22px"><img width="22px" height="22px" src="../resources/playlist/undo.png" /></td>
                    <td width="50%" align="left"> <a href="' . $megavideoScraper . '">Return to Link List</a></td>
                    <td width="22px"></td>
                    <td width="50%"></td>
                </tr>
              </table>' . "\n";
        echo $this->message . "\n";
        echo '
	    <script>
		function showAddDiv(div){
		    divSingle   = document.getElementById("singleId");
		    divMultiple = document.getElementById("multipleIds");
		    if( div == 1){
			divSingle.style.display = "block";
			divMultiple.style.display = "none";
		    }else{
			divSingle.style.display = "none";
			divMultiple.style.display = "block";
		    }


		}
	    </script>' . "\n";
        echo '
		<div align="center" style="padding:10px">
		    <input type="button" name="btnSingleId" value="INSERT SINGLE MEGAVIDEO LINK" onclick="showAddDiv(1)" style="cursor:hand;cursor:pointer;" />
		    &nbsp;&nbsp;&nbsp;
		    <input type="button" name="btnMultipleIds" value="INSERT MULTIPLE MEGAVIDEO LINKS" onclick="showAddDiv(2)" style="cursor:hand;cursor:pointer;" />
		</div>' . "\n";
        echo '<div id="singleId">' . "\n";
        echo '<form action="index.php">' . "\n";
        echo '<table class="playlistTable">' . "\n";
        echo '  <thead>' . "\n";
        echo '      <tr>' . "\n";
        echo '          <th width="24px">Insert single Megavideo ID</th>' . "\n";
        echo '      </tr>' . "\n";
        echo '  </thead>' . "\n";
        echo '  <tbody>' . "\n";
        echo '      <tr>' . "\n";
        echo '          <td>' . "\n";
        echo '              <p>Fill Title, Description and Image fields to override Megavideo info. If you leave it in blank, this fields will be filled with Megavideo values.</p>' . "\n";
        ?>

        <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td>Megavideo ID (*): </td>
                <td><input type="text" id="key" name="key" value="" size="20" /></td>
            </tr>
            <tr>
                <td>Title: </td>
                <td><input type="text" id="title" name="title" value="" size="40" /></td>
            </tr>
            <tr>
                <td>Description: </td>
                <td><textarea id="description" name="description" rows="8" cols="40"></textarea></td>
            </tr>
	    <tr>
                <td>Image: </td>
                <td><input type="text" id="image" name="image" value="" size="40" /></td>
            </tr>
	    <tr>
                <td>Add another one: </td>
                <td><input type="checkbox" id="addother" name="addother" checked="true" value="ON" /></td>
            </tr>
        </table>
        <input type="hidden" name="web" value="" />
        <input type="hidden" name="action" value="<?php 
        echo ViewScraperMegavideoPageAction::getActionName();
        ?>
" />
        <input type="hidden" name="subaction" value="<?php 
        echo ViewScraperMegavideoPageAction::SUBACTION_SAVE_LINK;
        ?>
" />
	<input type="hidden" name="typeadd" value="single" />
        <input type="hidden" name="PHPSESID" value="<?php 
        echo session_id();
        ?>
" />

        <?php 
        echo '          </td>' . "\n";
        echo '      </tr>' . "\n";
        echo '  </tbody>' . "\n";
        echo '  <tfoot>' . "\n";
        echo '      <tr><th align="right"><input type="submit" value="SAVE LINK" name="save" style="cursor:hand;height: 20px; font-size: 10px;" /> <input type="reset" value="CLEAR FIELDS" style="cursor:hand;height: 20px; font-size: 10px;" /></th></tr>' . "\n";
        echo '  </tfoot>' . "\n";
        echo '</table>' . "\n";
        echo '</form>' . "\n";
        echo '</div>' . "\n";
        //Multiple IDs
        echo '<div id="multipleIds" style="display:none;">' . "\n";
        echo '<form action="index.php">' . "\n";
        echo '<table class="playlistTable">' . "\n";
        echo '  <thead>' . "\n";
        echo '      <tr>' . "\n";
        echo '          <th width="24px">Multiple Megavideo IDs insert</th>' . "\n";
        echo '      </tr>' . "\n";
        echo '  </thead>' . "\n";
        echo '  <tbody>' . "\n";
        echo '      <tr>' . "\n";
        echo '          <td>' . "\n";
        echo '              <p>Fill Title, Description and Image fields to override Megavideo info. If you leave it in blank, this fields will be filled with Megavideo values.</p><p>Enter a Megavideo ID for each line.</p>' . "\n";
        ?>

        <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td>Megavideo ID: </td>
                <td><textarea id="key" name="key" rows="6" cols="50"></textarea></td>
            </tr>
            <tr>
                <td>Title (suffix count +1): </td>
                <td><input type="text" id="title" name="title" value="" size="40" /></td>
            </tr>
            <tr>
                <td>Description: </td>
                <td><textarea id="description" name="description" rows="8" cols="40"></textarea></td>
            </tr>
	    <tr>
                <td>Image: </td>
                <td><input type="text" id="image" name="image" value="" size="40" /></td>
            </tr>
        </table>
        <input type="hidden" name="web" value="" />
        <input type="hidden" name="action" value="<?php 
        echo ViewScraperMegavideoPageAction::getActionName();
        ?>
" />
        <input type="hidden" name="subaction" value="<?php 
        echo ViewScraperMegavideoPageAction::SUBACTION_SAVE_LINK;
        ?>
" />
	<input type="hidden" name="typeadd" value="multiple" />
        <input type="hidden" name="PHPSESID" value="<?php 
        echo session_id();
        ?>
" />

        <?php 
        echo '          </td>' . "\n";
        echo '      </tr>' . "\n";
        echo '  </tbody>' . "\n";
        echo '  <tfoot>' . "\n";
        echo '      <tr><th align="right"><input type="submit" value="SAVE LINKS" name="save" style="cursor:hand;height: 20px; font-size: 10px;" /> <input type="reset" value="CLEAR FIELDS" style="cursor:hand;height: 20px; font-size: 10px;" /></th></tr>' . "\n";
        echo '  </tfoot>' . "\n";
        echo '</table>' . "\n";
        echo '</form>' . "\n";
        echo '</div>' . "\n";
    }
    /**
     * Show page left menu.
     */
    private function showBodyLeftMenu()
    {
        $explorePlaylist = "index.php?web&action=" . ViewPlaylistWebPageAction::getActionName() . "&PHPSEDID=" . session_id();
        $addPlaylist = "index.php?web&action=" . ViewPlaylistWebPageAction::getActionName() . "&subaction=" . ViewPlaylistWebPageAction::SUBACTION_PLAYLIST_ADD . "&PHPSEDID=" . session_id();
        $megavideoScraper = "index.php?web&action=" . ViewScraperMegavideoPageAction::getActionName() . "&PHPSEDID=" . session_id();
        $megavideoScraperAdd = "index.php?web&action=" . ViewScraperMegavideoPageAction::getActionName() . "&subaction=" . ViewScraperMegavideoPageAction::SUBACTION_VIEW_ADD_LINK . "&PHPSEDID=" . session_id();
        $scrapers = "index.php?web&action=" . ViewScraperPageAction::getActionName() . "&PHPSEDID=" . session_id();
        $cookieSetup = "index.php?web&action=" . ViewCookiePageAction::getActionName() . "&PHPSEDID=" . session_id();
        $information = "index.php?web&action=" . ViewInformationPageAction::getActionName() . "&PHPSEDID=" . session_id();
        $favourites = "index.php?web&action=" . ViewFavouritePageAction::getActionName() . "&PHPSEDID=" . session_id();
        ?>
        <p style="text-align:left; color: #FFFFFF; font-size: 18px; margin-bottom: 12px; text-indent: 18px;">xVoD Menu</p>
        <div id="square-box">
            <div id="square-box-head">Playlist</div>
            <ul class="menu">
                <li><a href="<?php 
        echo $explorePlaylist;
        ?>
">Explore System</a></li>
                <li><a href="<?php 
        echo $addPlaylist;
        ?>
">Add Playlist</a></li>
            </ul>
        </div>

        <div id="square-box">
            <div id="square-box-head">xVoD Setup</div>
            <ul class="menu">
                <li><a href="<?php 
        echo $information;
        ?>
">Information</a></li>
                <li><a href="<?php 
        echo $cookieSetup;
        ?>
">Cookie MU/MV</a></li>
                <li><a href="<?php 
        echo $favourites;
        ?>
">Favourites</a></li>
                <li><a href="<?php 
        echo $scrapers;
        ?>
">Scrapers</a></li>
            </ul>
        </div>

        <div id="square-box">
            <div id="square-box-head">Megavideo Scraper</div>
            <ul class="menu">
		<li><a href="<?php 
        echo $megavideoScraperAdd;
        ?>
">Add link</a></li>
                <li><a href="<?php 
        echo $megavideoScraper;
        ?>
">Link list</a></li>
            </ul>
        </div>
        <?php 
    }