protected static function getSimpleHtmlFormPart()
 {
     $view = "";
     foreach (static::$dataStructure["data"] as $fildName => $fildParams) {
         $component = "";
         if ($fildParams["type"] == "text") {
             $component = "<input type='text' id='" . static::$dataStructure["htmlIdPrefix"] . $fildName . "' name='" . $fildName . "' value='' placeholder='' style='width: 500px;' />";
         } else {
             if ($fildParams["type"] == "textArea") {
                 $component = "<textarea id='" . static::$dataStructure["htmlIdPrefix"] . $fildName . "' name='" . $fildName . "' value='' placeholder='' style='width: 500px; height: 100px;' ></textarea>";
             } else {
                 if ($fildParams["type"] == "file") {
                     $component = "<input type='file' id='" . static::$dataStructure["htmlIdPrefix"] . $fildName . "' name='" . $fildName . "' />";
                 }
             }
         }
         if (isset($fildParams["view"])) {
             if ($fildParams["view"]["type"] = "img") {
                 $component = "<table><tr><td>" . $component . "</td><td><img style='height: 100px;' id='" . static::$dataStructure["htmlIdPrefix"] . $fildName . "_view' src='" . Config::getBaseURL() . "frontend/image/no_image.jpg' ></td></tr></table>";
             }
         }
         $view .= "<tr><td style='font-family: arial; font-size: 15px;'>" . $fildParams["name"] . "</td><td>" . $component . "</td></tr>";
     }
     return $view;
 }
 private static function getHTMLResponse($model)
 {
     $frontendRoot = Config::getModulesUrl() . "frame_mod_sweepstake_list/frontend/";
     $include = "\n\t\t\t\t<link rel='stylesheet' href='" . $frontendRoot . "css/frame_mod_sweepstake_list.css' type='text/css' />\n\t\t\t\t<link rel='stylesheet' href='" . Config::getBaseURL() . "frontend/lib/table_style1/css/style.css' type='text/css' />";
     $script = "";
     $html = "\n<div ng-app='FrameModSweepstakeList_Module' data-ng-init=\"_MODULE_ID_='" . $model->getModuleId() . "';sweepstakeBaseUrl='" . SweepstakeManager::getEndSweepstakeBaseUrl() . "'\"  ng-controller=\"FrameModSweepstakeList_Controller\">\n<div ng-include=\"'" . $frontendRoot . "html/frame_mod_sweepstake_list.html'\"></div>\n</div>\n\n<SCRIPT LANGUAGE='Javascript' SRC='" . $frontendRoot . "js/frame_mod_sweepstake_list.js'></SCRIPT>";
     $res = new FrameworkResponse();
     $res->setStatus(FrameworkResponse::$STATUS__READY);
     $res->setHtml($html);
     $res->setScript($script);
     $res->setImport($include);
     return $res;
 }
 private static function getHTMLResponse($model)
 {
     $frontendRoot = Config::getModulesUrl() . "frame_mod_entries_list/frontend/";
     $include = "<SCRIPT LANGUAGE='Javascript' SRC='" . $frontendRoot . "js/frame_mod_entries_list.js'></SCRIPT>\n\t\t\t\t \t<link rel='stylesheet' href='" . $frontendRoot . "css/frame_mod_entries_list.css' type='text/css' />\n\t\t\t\t \t<link rel='stylesheet' href='" . Config::getBaseURL() . "frontend/lib/table_style1/css/style.css' type='text/css' />";
     $script = "\nvar " . self::$jsManagerName . " = new FrameModEntriesList_manager();\n" . self::$jsManagerName . ".startWork( '" . $model->getModuleId() . "', 'frameModEntriesList_parentElement', 'frameModEntriesList_sweepstakeId' );\n";
     $html = "<input type='hidden' id='frameModEntriesList_sweepstakeId' value='" . $model->getSweepstakeId() . "'><table width='80%'><tr><td><div id='frameModEntriesList_parentElement'></div></td></tr></table>";
     $res = new FrameworkResponse();
     $res->setStatus(FrameworkResponse::$STATUS__READY);
     $res->setHtml($html);
     $res->setScript($script);
     $res->setImport($include);
     return $res;
 }
 private static function getHTMLResponse($model)
 {
     $res = new FrameworkResponse();
     $res->setStatus(FrameworkResponse::$STATUS__CHANGE_MODULE);
     $moduleClass = $model->getModuleClassName() . "_Model";
     if ($model->getCurrentState() == $moduleClass::$STATE__EDIT) {
         $frontendRoot = Config::getModulesUrl() . $model->getModuleDirName() . "/frontend/";
         $include = "\n<SCRIPT LANGUAGE='Javascript' SRC='" . Config::getBaseURL() . "frontend/js/framework/core/module/edit_form/frame_mod_edit_form_view_parent.js'></SCRIPT>\n<SCRIPT LANGUAGE='Javascript' SRC='" . $frontendRoot . "js/" . $model->getModuleDirName() . ".js'></SCRIPT>\n<link rel='stylesheet' href='" . $frontendRoot . "css/" . $model->getModuleDirName() . ".css' type='text/css' />";
         $html = "\n<div>\n<input type='hidden' id='frameModEditMessage_sweepstakeId' value='-1' />\n<table cellpadding='10' cellspacing='10'>" . self::getSimpleHtmlFormPart() . "\t<tr><td colspan='2'><div id='frameModEditMessage_status'></div></td></tr>\n\t<tr><td colspan='2' align='center'><input type='button' value='save' id='frameModEditMessage_submit' style='width: 100px;'></td></tr>\n</table>\n</div>";
         $sweepstakeData = $model->getCurrentSweepstakeData();
         $script = "\ndocument.getElementById( 'frameModEditMessage_sweepstakeId' ).value = '" . $model->getSweepstakeId() . "';\n" . self::setFormData($sweepstakeData) . "\n\nvar " . self::$jsManagerName . " = new " . $model->getModuleClassName() . "_manager();\n" . self::$jsManagerName . ".startWork( '" . $model->getModuleId() . "', 'frameModEditMessage_sweepstakeId', 'frameModEditMessage_submit', 'frameModEditMessage_status', JSON.parse( '" . json_encode(self::$dataStructure) . "' ) );\n";
         $res->setStatus(FrameworkResponse::$STATUS__READY);
         $res->setHtml($html);
         $res->setScript($script);
         $res->setImport($include);
     }
     return $res;
 }
 private static function getHTMLResponse($model)
 {
     $res = new FrameworkResponse();
     $res->setStatus(FrameworkResponse::$STATUS__CHANGE_MODULE);
     $moduleClass = $model->getModuleClassName() . "_Model";
     if ($model->getCurrentState() == $moduleClass::$STATE__MAIN_VIEW) {
         $sweepstakeData = $model->getListData();
         $frontendRoot = Config::getModulesUrl() . $model->getModuleDirName() . "/frontend/";
         $include = "<SCRIPT LANGUAGE='Javascript' SRC='" . $frontendRoot . "js/" . $model->getModuleDirName() . ".js'></SCRIPT>\n\t\t\t\t\t\t<link rel='stylesheet' href='" . $frontendRoot . "css/" . $model->getModuleDirName() . ".css' type='text/css' />\n\t\t\t\t\t\t<link rel='stylesheet' href='" . Config::getBaseURL() . "frontend/lib/table_style1/css/style.css' type='text/css' />";
         $script = "\nvar " . self::$jsManagerName . " = new " . $model->getModuleClassName() . "_manager();\n" . self::$jsManagerName . ".startWork( '" . $model->getModuleId() . "', '" . $model->getSweepstakeId() . "', 'frameModWinnersList_parentElement', 'frameModWinnersList_chooseWinners', 'frameModWinnersList_count' );\n";
         $chooseWinners = "\n<table align='right'><tr>\n\t<td><input type='number' id='frameModWinnersList_count' style='width: 50px; height: 50px;' placeholder='count' value='1' /></td>\n\t<td><input type='button' id='frameModWinnersList_chooseWinners' value='Choose Winners' style='height: 50px;' /></td>\n</tr></table>";
         $html = "\n<table width='80%'>\n<tr><td>" . $chooseWinners . "</td></tr>\n<tr><td><div id='frameModWinnersList_parentElement'></div></td></tr>\n</table>";
         $res->setStatus(FrameworkResponse::$STATUS__READY);
         $res->setHtml($html);
         $res->setScript($script);
         $res->setImport($include);
     }
     return $res;
 }
 private static function getHTMLResponse($model)
 {
     $res = new FrameworkResponse();
     if ($model->getCurrentState() == FrameModEditSweepstake_Model::$STATE__CREATE || $model->getCurrentState() == FrameModEditSweepstake_Model::$STATE__EDIT) {
         $frontendRoot = Config::getModulesUrl() . "frame_mod_edit_sweepstake/frontend/";
         $include = "\n\t\t\t\t\t\n\t\t\t\t\t<SCRIPT LANGUAGE='Javascript' SRC='" . $frontendRoot . "js/frame_mod_edit_sweepstake.js'></SCRIPT>\n\t\t\t\t\t<link rel='stylesheet' href='" . $frontendRoot . "css/frame_mod_edit_sweepstake.css' type='text/css' />\n\t\t\t\t\t<SCRIPT LANGUAGE='Javascript' SRC='" . $frontendRoot . "js/jquery.datetimepicker.js'></SCRIPT>\n\t\t\t\t\t<link rel='stylesheet' href='" . $frontendRoot . "css/jquery.datetimepicker.css' type='text/css' />\n\t\t\t\t\t<SCRIPT LANGUAGE='Javascript' SRC='" . $frontendRoot . "js/tiny.editor.packed.js'></SCRIPT>\n\t\t\t\t\t<link rel='stylesheet' href='" . $frontendRoot . "css/tinyeditor.css' type='text/css' />\n\t\t\t\t\t<SCRIPT LANGUAGE='Javascript' SRC='" . Config::getBaseURL() . "frontend/lib/bootstrap-select/js/bootstrap-select.js'></SCRIPT>\n\t\t\t\t\t<link rel='stylesheet' href='" . Config::getBaseURL() . "frontend/lib/bootstrap-select/css/bootstrap-select.css' type='text/css' />\n\t\t\t\t\t<SCRIPT LANGUAGE='Javascript' SRC='" . Config::getBaseURL() . "frontend/lib/angular-wysiwyg/js/bootstrap-colorpicker-module.js'></SCRIPT>\n\t\t\t\t\t<SCRIPT LANGUAGE='Javascript' SRC='" . Config::getBaseURL() . "frontend/lib/angular-wysiwyg/js/angular-wysiwyg.js'></SCRIPT>\n\t\t\t\t\t<link rel='stylesheet' href='" . Config::getBaseURL() . "frontend/lib/angular-wysiwyg/css/style.css' type='text/css' />\n\t\t\t\t\t<script>\n\t\t\t\t\t\tvar FrameModEditSweepstake_ModuleObj = angular.module('FrameModEditSweepstake_Module', ['myFrameworkCoreModule', 'colorpicker.module', 'wysiwyg.module']);\n\t\t\t\t\t</script>\n\t\t\t\t\t<style>\n\t\t\t\t\t\t\t@charset \"UTF-8\";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}\n\t\t\t\t\t</style>";
         $script = "\n\$('#frameModEditSweepstake_startDate').datetimepicker({\n\tdayOfWeekStart : 1,\n\tlang:'en',\n\tstartDate:\tFrameModEditSweepstake_manager.getStringFromTime( new Date() )\n});\n\$('#frameModEditSweepstake_startDate').datetimepicker({value: FrameModEditSweepstake_manager.getStringFromTime( new Date() ),step:10});\n\n\$('#frameModEditSweepstake_endDate').datetimepicker({\n\tdayOfWeekStart : 1,\n\tlang:'en',\n\tstartDate: FrameModEditSweepstake_manager.getStringFromTime( new Date() )\n});\n\$('#frameModEditSweepstake_endDate').datetimepicker({value: FrameModEditSweepstake_manager.getStringFromTime( new Date() ),step:10});\n\t\t\t";
         $html = "\n<div class='container-fluid' style='width: 80%;' ng-app='FrameModEditSweepstake_Module' data-ng-init=\"datatext=''\">\n<input type='hidden' id='frameModEditSweepstake_sweepstakeId' value='-1' />\n<form class='container-fluid form-horizontal' role='form'>\n\t<div class='form-group'>\n\t\t<label for='frameModEditSweepstake_title' class='col-sm-2 control-label'>Title</label>\n\t\t<div class='col-sm-10'>\n\t\t\t<input type='text' class='form-control' id='frameModEditSweepstake_title' placeholder='sweepstake title'>\n\t\t</div>\n\t</div>\n\t<div class='form-group'>\n\t\t<label for='frameModEditSweepstake_desc' class='col-sm-2 control-label'>Description</label>\n\t\t<div class='col-sm-10'>\n\t\t\t<wysiwyg textarea-id='frameModEditSweepstake_desc' textarea-class='form-control'  textarea-height='180px' textarea-name='textareaQuestion' ng-model='datatext' enable-bootstrap-title='true'></wysiwyg>\n\t\t</div>\n\t</div>\n\t<div class='form-group'>\n\t\t<label for='frameModEditSweepstake_restricText' class='col-sm-2 control-label'>Restrictions</label>\n\t\t<div class='col-sm-10'>\n\t\t\t<input type='text' class='form-control' id='frameModEditSweepstake_restricText' placeholder='Age restriction text for user'>\n\t\t</div>\n\t</div>\n\t<div class='form-group'>\n\t\t<label for='frameModEditSweepstake_startDate' class='col-sm-2 control-label'>Start Date</label>\n\t\t<div class='col-sm-10'>\n\t\t\t<input type='text' class='form-control' id='frameModEditSweepstake_startDate' style='width: 200px;'>\n\t\t</div>\n\t</div>\n\t<div class='form-group'>\n\t\t<label for='frameModEditSweepstake_endDate' class='col-sm-2 control-label'>End Date</label>\n\t\t<div class='col-sm-10'>\n\t\t\t<input type='text' class='form-control' id='frameModEditSweepstake_endDate' style='width: 200px;'>\n\t\t</div>\n\t</div>\n\t<div class='form-group'>\n\t\t<label class='col-sm-2 control-label'>Entry Settings</label>\n\t\t<div class='col-sm-10'>\n\t\t\t<div>\n\t\t\t\t<label style='font-weight: normal;'>\n\t\t\t\t\tOnly allow users to enter once per <select id='frameModEditSweepstake_enterOnceType' class='selectpicker'><option value='0'>Facebook User</option><option value='1'>Facebook User per day</option></select>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<label style='font-weight: normal;'>\n\t\t\t\t\tAward <input type='number' id='frameModEditSweepstake_bonusPoint' value='1' class='form-control' style='width: 70px; display: unset;' min='0'> bonus entries per <select id='frameModEditSweepstake_bonusEnterType' class='selectpicker'><option value='0'>Facebook friend that enters after entrant.</option><option value='1'>User that clicks and enters from entrant's shared link.</option></select>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t\t<div class='checkbox'>\n\t\t\t\t<label>\n\t\t\t\t\t<input type='checkbox' id='frameModEditSweepstake_publishEnter'> Automatically post Opengraph Enter action to user's Facebook Timeline\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class='form-group'>\n\t\t<label for='frameModEditSweepstake_minAge' class='col-sm-2 control-label'>Age Restriction</label>\n\t\t<div class='col-sm-10'>\n\t\t\t<div class='input-group'>\n\t\t\t\t<span class='input-group-addon'>\n\t\t\t\t\t<input type='checkbox'>\n\t\t\t\t</span>\n\t\t\t\t<select  class='form-control selectpicker' id='frameModEditSweepstake_minAge'><option value='0'>No Restriction</option><option value='13'>13 Year</option><option value='18'>18 Year</option><option value='21'>21 Year</option></select>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class='form-group'><div class='col-sm-11 col-sm-offset-1'><div class='alert alert-danger' role='alert' id='frameModEditSweepstake_status'></div></div></div>\n\t<div class='form-group'><div class='col-sm-2' style='text-align: right;'><button id='frameModEditSweepstake_submit' class='btn btn-success'>Save</button></div></div>\n</form>\n</div>";
         if ($model->getCurrentState() == FrameModEditSweepstake_Model::$STATE__EDIT) {
             $sweepstakeData = $model->getCurrentSweepstakeData();
             $script .= "\ndocument.getElementById( 'frameModEditSweepstake_sweepstakeId' ).value = '" . $model->getSweepstakeId() . "';\ndocument.getElementById( 'frameModEditSweepstake_title' ).value = '" . addslashes(preg_replace("/\r|\n/", "", $sweepstakeData["title"])) . "';\n//document.getElementById( 'frameModEditSweepstake_desc' ).value = '" . addslashes(preg_replace("/\r|\n/", "", $sweepstakeData["desc"])) . "';\ndocument.getElementById( 'frameModEditSweepstake_restricText' ).value = '" . addslashes($sweepstakeData["restriction_text"]) . "';\ndocument.getElementById( 'frameModEditSweepstake_enterOnceType' ).value = '" . addslashes($sweepstakeData["enter_once_type"]) . "';\ndocument.getElementById( 'frameModEditSweepstake_bonusPoint' ).value = '" . addslashes($sweepstakeData["bonus_point"]) . "';\ndocument.getElementById( 'frameModEditSweepstake_bonusEnterType' ).value = '" . addslashes($sweepstakeData["bonus_enter_type"]) . "';\ndocument.getElementById( 'frameModEditSweepstake_publishEnter' ).checked = " . ($sweepstakeData["publish_enter"] == "1" ? "true" : "false") . ";\ndocument.getElementById( 'frameModEditSweepstake_minAge' ).value = '" . addslashes($sweepstakeData["min_age"]) . "';\ndocument.getElementById( 'frameModEditSweepstake_status' ).value = '';\n\n\$('#frameModEditSweepstake_startDate').datetimepicker({value: FrameModEditSweepstake_manager.getStringFromTime( new Date( " . $sweepstakeData["start_date"] * 1000 . " ) ),step:10});\n\$('#frameModEditSweepstake_endDate').datetimepicker({value: FrameModEditSweepstake_manager.getStringFromTime( new Date( " . $sweepstakeData["end_date"] * 1000 . " ) ),step:10});\n";
         }
         $script .= "\n\n\t\t\n\$( document.getElementById( 'frameModEditSweepstake_enterOnceType' ) ).selectpicker();\n\$( document.getElementById( 'frameModEditSweepstake_bonusEnterType' ) ).selectpicker();\n\nvar editor1 = {};\n/*\nvar editor1 = new TINY.editor.edit('editor1', {\n\tid: 'frameModEditSweepstake_desc',\n\twidth: 600,\n\theight: 100,\n\tcssclass: 'tinyeditor',\n\tcontrolclass: 'tinyeditor-control',\n\trowclass: 'tinyeditor-header',\n\tdividerclass: 'tinyeditor-divider',\n\tcontrols: ['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|',\n\t\t'orderedlist', 'unorderedlist', '|', 'outdent', 'indent', '|', 'leftalign',\n\t\t'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n',\n\t\t'font', 'size', 'style', '|', 'image', 'hr', 'link', 'unlink', '|', 'print'],\n\tfooter: true,\n\tfonts: ['Verdana','Arial','Georgia','Trebuchet MS'],\n\txhtml: true,\n\tbodyid: 'editor',\n\tfooterclass: 'tinyeditor-footer',\n\ttoggle: {text: 'source', activetext: 'wysiwyg', cssclass: 'toggle'},\n\tresize: {cssclass: 'resize'}\n});\n*/\n\nvar " . self::$jsManagerName . " = new FrameModEditSweepstake_manager();\n" . self::$jsManagerName . ".startWork( '" . $model->getModuleId() . "', 'frameModEditSweepstake_sweepstakeId', 'frameModEditSweepstake_submit', 'frameModEditSweepstake_status', editor1 );\n";
         $res->setStatus(FrameworkResponse::$STATUS__READY);
         $res->setHtml($html);
         $res->setScript($script);
         $res->setImport($include);
     } else {
         $res->setStatus(FrameworkResponse::$STATUS__CHANGE_MODULE);
     }
     return $res;
 }
Example #7
0
    echo \Config::getBaseURL();
    ?>
frontend/css/main.css' type='text/css' />
	<SCRIPT LANGUAGE='Javascript' SRC='<?php 
    echo \Config::getBaseURL();
    ?>
frontend/js/multiapplication.js'></SCRIPT>
	<SCRIPT LANGUAGE='Javascript' SRC='<?php 
    echo \Config::getBaseURL();
    ?>
frontend/js/lib.js'></SCRIPT>
	<SCRIPT LANGUAGE='Javascript' SRC='<?php 
    echo \Config::getBaseURL();
    ?>
frontend/js/ajax.js'></SCRIPT>
	<SCRIPT LANGUAGE='Javascript' SRC='<?php 
    echo \Config::getBaseURL();
    ?>
frontend/js/framework/core/core.js'></SCRIPT>
	<SCRIPT LANGUAGE='Javascript' SRC='<?php 
    echo \Config::getBaseURL();
    ?>
frontend/js/framework/core/module/frame_mod_parent.js'></SCRIPT>
	<script src='//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js'></script>
	<SCRIPT LANGUAGE='Javascript' SRC='<?php 
    echo \Config::getBaseURL();
    ?>
frontend/js/framework/core/angular_core.js'></SCRIPT>
<?php 
}
echo $responseForUser;
 public static function getEndSweepstakeBaseUrl()
 {
     return Config::getBaseURL() . self::$endSweepstakeBaseDir;
 }