Exemple #1
0
function exc_js()
{
    echo js_code('function jumpMenuIns(fc){
	var vr=document.getElementById(\'fprm\').value;
	var lk=fc+\'(\'+vr+\')\';
	insert(lk);}');
}
Exemple #2
0
function cnvs_com($d, $id)
{
    $r = explode(' ', $d);
    $n = count($r);
    for ($i = 0; $i < $n; $i++) {
        list($p, $o) = split('=', $r[$i]);
        $ra = explode(',', $o);
        switch ($p) {
            case 'line':
                $ret .= 'ctx.fillStyle="#' . $ra[4] . '"; ctx.moveTo(' . $ra[0] . ',' . $ra[1] . '); ctx.lineTo(' . $ra[2] . ',' . $ra[3] . '); ctx.stroke();';
                break;
            case 'rect':
                $ret .= 'ctx.fillStyle="#' . $ra[4] . '"; ctx.fillRect(' . $ra[0] . ',' . $ra[1] . ',' . $ra[2] . ',' . $ra[3] . '); ';
                break;
            case 'arc':
                $ret .= 'ctx.beginPath(); ctx.arc(' . $o . '*Math.PI); ctx.stroke();';
                break;
            case 'circle':
                $ret .= 'ctx.beginPath(); ctx.arc(' . $ra[0] . ',' . $ra[1] . ',' . $ra[2] . ',0,2*Math.PI); ctx.fillStyle="#' . $ra[3] . '"; ctx.stroke();';
                break;
            case 'disk':
                $ret .= 'ctx.beginPath(); ctx.arc(' . $ra[0] . ',' . $ra[1] . ',' . $ra[2] . ',0,2*Math.PI); ctx.fillStyle="#' . $ra[3] . '"; ctx.fill();';
                break;
            case 'text':
                $ret .= 'ctx.fillStyle="#' . $ra[5] . '"; ctx.font="' . ($ra[3] ? $ra[3] : 24) . 'px ' . ($ra[4] ? $ra[4] : 'Arial') . '"; ctx.fillText("' . $ra[0] . '",' . $ra[1] . ',' . $ra[2] . ');';
                break;
            case 'gradient':
                $ret .= 'var grd=ctx.createLinearGradient(0,0,200,0); 
grd.addColorStop(0,"red"); grd.addColorStop(1,"white");
ctx.fillStyle=grd; ctx.fillRect(10,10,150,80);';
                break;
        }
    }
    return js_code(cnvs_js($ret, $id));
}
Exemple #3
0
 static function sort($id, $url, $next = 'tbody')
 {
     core_js('jquery');
     core_js('jquery.ui');
     if ($next) {
         $nextStr = "ui.helper.find('td').css({'width':ui.helper.find('td').attr('width')});  ";
     }
     js_code(" \n\t\t\t\tvar   node_form_sort;\n\t\t\t\tvar fixHelper = function(e, ui) {\n\t\t\t        ui.children().each(function() {\n\t\t\t            \$(this).width(\$(this).width());                  \n\t\t\t        });\n\t\t\t        return ui;\n\t\t\t    };\n\t\t \t \t\$( '" . $id . " " . $next . "' ).sortable({ \n\t\t\t\thelper: fixHelper,\n\t\t\t\tstart:function(e, ui){  \n\t\t\t\t\tnode_form_sort=\$('" . $id . "').serialize();\n\t\t            ui.helper.addClass('highlight');  \n\t\t            " . $nextStr . " \n\t\t            return ui;  \n\t\t        },  \n\t\t        stop:function(e, ui){   \n\t\t           ui.item.removeClass('highlight');  \n\t\t           if(\$('" . $id . "').serialize() == node_form_sort ) return false; \n\t\t           \$.post('" . $url . "',  \$('" . $id . "').serialize(),function(data) {\n\t\t\t\t\t \t\$('.flash-message').html('" . __('success') . "').show().fadeOut(3000);\n\t\t\t\t   });\n\t\t           return ui;  \n\t\t        }  \t\n\t\t\t}).sortable('serialize'); ");
 }
Exemple #4
0
    function run()
    {
        $base = publish(dirname(__FILE__) . '/assets');
        if ($this->options) {
            $opts = CJavaScript::encode($this->options);
        }
        $tag = $this->tag;
        js_code('  
	 		$("' . $tag . '").cycle(' . $opts . ');
 		');
        js($base . '/jquery.cycle.all.js');
    }
Exemple #5
0
 function run()
 {
     $this->var = $this->tag;
     if ($this->options) {
         $opts = "," . CJavaScript::encode($this->options);
     }
     $base = publish(dirname(__FILE__) . '/assets');
     if (!$this->tag) {
         return;
     }
     js_code(" \n \t\t\t" . $this->var . " = CKEDITOR.replace('" . $this->tag . "'" . $opts . "); \n \t\t");
     js($base . '/ckeditor.js');
 }
Exemple #6
0
 function run()
 {
     $result = CDB()->from('attachments');
     $posts = CDB()->from('attachments');
     $pager = new PagerHelper($result, $posts);
     $pager->pageSize = 5;
     $pager = $pager->run();
     if (true === Yii::app()->request->isAjaxRequest) {
         Yii::app()->controller->layout = false;
     }
     js_code("\n\t\t\tfunction ajax_body_insert(){\n\t\t\t\t\$('#ajax_body img').click(function(){  \n\t\t\t\t\tvar rel = \$(this).attr('rel'); \n\t\t\t\t\t" . $this->tag . ".insertHtml('<img src='+rel+' />');\n\t\t\t\t\t\$('#ajax_body #up').fadeIn().fadeOut(2000);\n\t\t\t\t}); \n\t\t\t}\n\t\t\tajax_body_insert();\n\t\t\tfunction ajaxPager(){\n\t\t\t\t\$('#ajaxPager a').click(function(){ \n\t\t\t\t\tvar url = \$(this).attr('href'); \n\t\t\t\t\t\$.post(url,function(data){ \n\t\t\t\t\t\tdata = substr(data,strpos(data,'<!--###-->')); \n\t\t\t\t\t\tdata = substr(data,0,strpos(data,'<!--/###-->')); \n\t\t\t\t\t\t\$('#ajaxContent').html(data); \n\t\t\t\t\t\tajaxPager();  \n\t\t\t\t\t\tinsertImg();\n\t\t\t\t\t\tajax_body_insert();\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t}\n\t\t\tajaxPager();\n\t\t\tfunction insertImg(){\n\t\t\t\t\$('#insertImg').click(function(){ \n\t\t\t\t\tif(\$('#ajax_body').css('display')=='none')\n\t\t\t\t    \t\$('#ajax_body').show();\n\t\t\t\t    else\n\t\t\t\t    \t\$('#ajax_body').hide();\n\t\t\t\t });\n\t\t\t}\n\t\t\tinsertImg();\n\t\t\t");
     $this->render('index', array('pager' => $pager));
 }
Exemple #7
0
 function run()
 {
     if ($this->options) {
         $opts = CJavaScript::encode($this->options);
     }
     $base = publish(dirname(__FILE__) . '/assets');
     core_js('jquery');
     js($base . '/imagesloaded.js');
     if (!$this->tag) {
         return;
     }
     js_code('Imagesloaded_' . $this->tag, " \n \t\t\t\$('" . $this->tag . "').imagesLoaded({$opts}); \n \t\t");
 }
Exemple #8
0
function plug_sticky($d)
{
    $d = $d != '' ? $d : 1;
    $id = 'np' . randid();
    $ret = hidden('', 'cka', 'm' . $d);
    $ret .= ljb('poph" id="ckb', 'mem_storage', $id . '_m' . $d . '_1_1_ckb' . $d, picto('reload'));
    //$ret.=ljb('popbt" id="ckc','mem_storage',$id.'_m'.$d.'__1_ckc','save');
    //$ret.=ljb('popbt" id="ckb'.$d,'mem_storage',$id.'_m'.$d.'_1_1_ckb'.$d.'_memnu','restore');
    $ret .= ljb('poph" id="ckc', 'mem_storage', $id . '_cka__1_ckc', pictit('save', 'save'));
    $ret = divs('float:right;', $ret);
    $ret .= divedit($id, '', 'height:240px; overflow:auto; padding:10px;', $j, $txt);
    $ret .= js_code('document.getElementById(\'' . $id . '\').innerHTML=localStorage[\'m' . $d . '\']');
    return popup_stick($ret);
}
Exemple #9
0
 function run()
 {
     if ($this->params) {
         $opts = CJavaScript::encode($this->params);
     }
     $base = publish(dirname(__FILE__) . '/select2-3.3.2');
     core_js('jquery');
     css($base . '/select2.css');
     js($base . '/select2.js');
     if (!$this->tag) {
         return;
     }
     js_code('select2_' . $this->tag, " \n \t\t\t\$('" . $this->tag . "').select2({$opts}); \n \t\t");
 }
Exemple #10
0
 function run()
 {
     if ($this->params) {
         $opts = CJavaScript::encode($this->params);
     }
     $base = publish(dirname(__FILE__) . '/redactor');
     core_js('jquery');
     css($base . '/redactor.css');
     //script($base.'/redactor.js');
     js($base . '/redactor.zh.js');
     if (!$this->tag) {
         return;
     }
     js_code('redactor_' . $this->tag, " \n \t\t\t\$('" . $this->tag . "').redactor({$opts}); \n \t\t");
 }
Exemple #11
0
 function run()
 {
     if ($this->multi === false) {
         $this->max = 1;
     }
     $base = publish(dirname(__FILE__) . '/assets');
     core_js('jquery');
     core_js('jquery.ui');
     js($base . '/browserplus-min.js');
     js($base . '/plupload.full.js');
     $this->url = url('admin/plupload/index');
     $container = 'c_' . md5(uniqid()) . mt_rand(0, 900000);
     $filelist = 'f_' . md5(uniqid()) . mt_rand(0, 900000);
     $pickfiles = 'p_' . md5(uniqid()) . mt_rand(0, 900000);
     js_code("\n \t\t\tvar uploader_" . md5($this->field) . " = new plupload.Uploader({\n\t\truntimes : 'gears,html5,flash,silverlight,browserplus',\n\t\tbrowse_button : '" . $pickfiles . "',\n\t\tcontainer : '" . $container . "',\n\t\tmultipart_params:{field:'" . $this->field . "'},\n\t\tmax_file_size : '" . $this->max_file_size . "',\n\t\tmulti_selection:'" . $this->multi . "',\n\t\turl : '" . $this->url . "',\n\t\tflash_swf_url : '" . $base . "/plupload.flash.swf',\n\t\tsilverlight_xap_url : '" . $base . "plupload.silverlight.xap',\n\t\tfilters : [\n\t\t\t{title : \"" . __('choice file') . "\", extensions : \"" . $this->ext . "\"} \n\t\t],\n\t \n\t});\n\n \n\n\t\$('#uploadfiles').click(function(e) {\n\t\tuploader_" . md5($this->field) . ".start();\n\t\te.preventDefault();\n\t});\n\n\tuploader_" . md5($this->field) . ".init();\n\n\tuploader_" . md5($this->field) . ".bind('FilesAdded', function(up, files) {\n\t\tif (up.files.length > " . $this->max . ") {\n\t\t\talert('" . __('not allow upload') . "');\n            return false;\n        }\n\t\t\$.each(files, function(i, file) {\n\t\t\t\$('#" . $filelist . "').append(\n\t\t\t\t'<div id=\"' + file.id + '\">' +\n\t\t\t\tfile.name + ' (' + plupload.formatSize(file.size) + ') <b></b>' +\n\t\t\t'</div>');\n\t\t\tuploader_" . md5($this->field) . ".start();  \n\t\t});\n\t\t\n\t\tup.refresh(); // Reposition Flash/Silverlight\n\t});\n\n\tuploader_" . md5($this->field) . ".bind('UploadProgress', function(up, file) {\n\t\t\$('#' + file.id + \" b\").html(file.percent + \"%\");\n\t});\n\n\tuploader_" . md5($this->field) . ".bind('Error', function(up, err) {\n\t\t\$('#" . $filelist . "').append(\"<div>Error: \" + err.code +\n\t\t\t\", Message: \" + err.message +\n\t\t\t(err.file ? \", File: \" + err.file.name : \"\") +\n\t\t\t\"</div>\"\n\t\t);\n\n\t\tup.refresh(); // Reposition Flash/Silverlight\n\t});\n\tuploader_" . md5($this->field) . ".bind('FileUploaded', function(up, file,data) {  \n\t\tdata = eval(data);\n\t\tdata = data.response;  \n\t \t\$('#" . $filelist . "').append(data); \n\t\t\$('#' + file.id + \" \").html(\"\");\n\t\tplupload_after_" . md5($this->field) . "();\n\t});\n\tplupload_after_" . md5($this->field) . "();\n\tfunction plupload_after_" . md5($this->field) . "(){\n\t\t\$('#" . $container . " .file .icon-remove').click(function(){\n\t\t\t\$(this).parent('div.file:first').remove();\n\t\t});\n\t\t\n\t\t\$( '#" . $filelist . "' ).sortable();\n    }\n \t\t");
     $this->render('index', array('container' => $container, 'filelist' => $filelist, 'field' => $this->field, 'values' => $this->values, 'pickfiles' => $pickfiles, 'info' => $this->info));
 }
Exemple #12
0
 /**
  *  
  * Example :
  *  
  * <code> 
  *	widget('icheck' , array(
  *		'skin'=>'flat', 
  *		'color'=>'blue'
  *	));
  *</code> 
  */
 function run()
 {
     $this->options['checkboxClass'] = $this->options['checkboxClass'] ? $this->options['checkboxClass'] : 'icheckbox_' . $this->skin;
     $this->options['radioClass'] = $this->options['radioClass'] ? $this->options['radioClass'] : 'iradio_' . $this->skin;
     if ($this->color) {
         $this->options['checkboxClass'] .= "-" . $this->color;
         $this->options['radioClass'] .= "-" . $this->color;
     }
     $opts = CJavaScript::encode($this->options);
     $base = publish(dirname(__FILE__) . '/assets');
     core_js('jquery');
     js_code("\$('" . $this->tag . "').iCheck({$opts});");
     $skin = $this->skin . "/" . $this->skin;
     $color = $this->skin . "/" . $this->color;
     css($base . '/skins/' . $skin . '.css');
     css($base . '/skins/' . $color . '.css');
     css($base . '/skins/flat/blue.css');
     js($base . '/jquery.icheck.min.js');
 }
Exemple #13
0
 function run()
 {
     if ($this->options) {
         $opts = CJavaScript::encode($this->options);
     }
     $base = publish(dirname(__FILE__) . '/assets');
     core_js('jquery');
     css($base . '/jquery.fancybox.css?v=2.1.5');
     css($base . '/jquery.fancybox-buttons.css?v=1.0.5');
     css($base . '/jquery.fancybox-thumbs.css?v=1.0.7');
     js($base . '/jquery.mousewheel-3.0.6.pack.js');
     js($base . '/jquery.fancybox.pack.js?v=2.1.5');
     js($base . '/jquery.fancybox-buttons.js?v=1.0.5');
     js($base . '/jquery.fancybox-media.js?v=1.0.6');
     js($base . '/jquery.fancybox-thumbs.js?v=1.0.7');
     if (!$this->tag) {
         return;
     }
     js_code("\n \t\t\t\$('" . $this->tag . "').fancybox({$opts}); \n \t\t");
 }
Exemple #14
0
    function run()
    {
        $base = publish(dirname(__FILE__) . '/assets');
        $this->options['flashplayer'] = $base . "/jwplayer.flash.swf";
        $this->options['width'] = $this->options['width'] ? $this->options['width'] : $this->width;
        $this->options['height'] = $this->options['height'] ? $this->options['height'] : $this->height;
        if ($this->file) {
            $this->options['file'] = $this->file;
        }
        if ($this->image) {
            $this->options['image'] = $this->image;
        }
        $opts = CJavaScript::encode($this->options);
        $tag = $this->tag;
        $tag = str_replace('#', '', $tag);
        $tag = str_replace('.', '', $tag);
        js_code('  
	 		jwplayer("' . $tag . '").setup(' . $opts . ');
 		');
        js($base . '/jwplayer.js');
    }
Exemple #15
0
 /**
  * masonry/scroll images
  *
  * Example masonry:
  *  
  * <code> 
  * <?php
  *	widget('masonry' , array('tag'=>'#masonry'));
  *	css("
  *		#masonry li{ 
  *			list-style:none; 
  *			float:left;
  *			margin-rigth:10px;
  *		}
  *	");
  * ?>
  * <div id='masonry'>
  *	 <ul>
  *	 <?php for($j=1;$j<=50;$j++){?>
  *	 	<?php for($i=1;$i<=6;$i++){?>
  *		 	<li class='item'>
  *		 		<?php echo image("upload/t/{$i}.jpg" , array( 'resize' => array(120)));?>
  *		 	</li>
  *	 	<?php }?>
  *	 <?php }?>
  *	 </ul> 
  * </div>
  * </code>  
  * Example scroll:
  * <code>
  *	<?php 
  *	$data = \application\core\DB::pagination('file');
  *	$count = $data->pages->itemCount;
  *	$size = $data->pages->pageSize;
  *	$models = $data->models;  
  *	widget('masonry' , array(
  *		'tag'=>'#masonry',
  *		'scroll'=>true
  *	));
  *	css("
  *		#masonry li{ 
  *			list-style:none; 
  *			float:left;
  *			margin-rigth:10px;
  *		}
  *	");
  *	 ?>
  *	 <div id='masonry'>
  *		 <ul> 
  *		 	<?php foreach($models as $v){?>
  *			 	<li class='item'>
  *			 		<?php echo image($v['path'] , array( 'resize' => array(120)));?>
  *			 	</li>
  *		 	<?php }?> 
  *		 </ul> 
  *	</div>
  *</code> 
  *
  * Example scroll 2:
  *
  * <code>
  *	use application\core\Pagination;
  *	$size = 20;
  *	$arr = Pagination::img($post->img , $size); 
  *	$models = $arr['models'];
  *	$pages = $arr['pages'];
  *	$count = $arr['count']; 
  *	echo \application\core\Pagination::next($count,$size);
  * </code>
  */
 function run()
 {
     core_js('jquery');
     $base = publish(dirname(__FILE__) . '/assets');
     $tag = $this->tag;
     $bottom = $this->bottom ? $this->bottom : true;
     $itemSelector = $this->itemSelector ? $this->itemSelector : '.item';
     if (!$this->options['itemSelector']) {
         $this->options['itemSelector'] = $itemSelector;
     }
     $opts = CJavaScript::encode($this->options);
     if ($this->scroll === true) {
         if (true === $this->css) {
             css_code("\n\t\t\t\t#infscr-loading div{} \n\t\t\t\t\t\t#infscr-loading{clear:both; position: absolute;padding-left:10px;\n\t\t\t\t\t\tbottom: -25px;width: 200px;}#infscr-loading img{float: left;margin-right: 5px;}");
         }
         if (!$this->options['loading']['img']) {
             $this->options['loading']['img'] = $base . "/ajax-loader.gif";
         }
         if (!$this->options['loading']['msgText']) {
             $this->options['loading']['msgText'] = __('loading content……');
         }
         if (!$this->options['loading']['finishedMsg']) {
             $this->options['loading']['finishedMsg'] = __('it is over');
         }
         if (!$this->options['dataType']) {
             $this->options['dataType'] = 'html';
         }
         if (!$this->options['navSelector']) {
             $this->options['navSelector'] = 'div.pagination';
         }
         if (!$this->options['nextSelector']) {
             $this->options['nextSelector'] = 'div.pagination a';
         }
         if (!$this->options['itemSelector']) {
             $this->options['itemSelector'] = $itemSelector;
         }
         $infinitescrollOpts = CJavaScript::encode($this->options);
         widget("imagesloaded", array('tag' => null));
         js_code("\n\t\t\t\tvar \$container = \$('" . $tag . "');\n\t\t \t\t\$container.imagesLoaded(function(){\n\t\t\t     \$container.masonry({$opts});\n\t\t\t    });   \n\t\t\t\tvar \$container = \$('" . $tag . "');\n\t\t\t\t\t\$container.infinitescroll(" . $infinitescrollOpts . ",  \n\t\t\t\t  function( newElements ) { \n\t\t\t\t    var \$newElems = \$( newElements ).css({ opacity: 0 });\n\t\t\t        \$newElems.imagesLoaded(function(){\n\t\t\t          \$newElems.animate({ opacity: 1 });\n\t\t\t          \$container.masonry( 'applicationended', \$newElems, true ); \n\t\t\t        });\n\n\t\t\t\t  }\n\t\t\t\t); \n\t\t\t");
         js($base . '/jquery.infinitescroll.js');
     } else {
         js_code("\n\t\t\t\tvar \$container = \$('" . $tag . "');\n\t\t \t\t\$container.imagesLoaded(function(){\n\t\t\t     \$container.masonry({$opts});\n\t\t\t    });  \n\t\t\t");
     }
     js($base . '/jquery.masonry.min.js');
     js($base . '/jquery.imagesloaded.min.js');
 }
Exemple #16
0
            }
            ?>
			<p class='well'> <i class="icon-trash hander remove" style="float:right;"></i>
				<input name="key[]" class="input-large" value="<?php 
            echo $k;
            ?>
" style='width:80%;margin-bottom:5px;'> 
				<textarea name="value[]" class="input-large" style='width:80%'> <?php 
            echo $v;
            ?>
 </textarea>
			</p>
		<?php 
        }
        ?>
	<?php 
    }
    ?>
	
	<?php 
    $this->endWidget();
    ?>

</div>
<?php 
}
?>
</div>
<?php 
js_code('i18n_js', "\n\$('.add').click(function(){\n\t\$('p:first').before('<p class=\\'well\\'>'+\$('p:first').html()+'</p>');\n\t\$('p:first').find('input').val('');\n\t\$('p:first').find('textarea').val('');\n\tmodule_i18n_remove(); \n});\nmodule_i18n_remove();\nfunction module_i18n_remove(){\n\t\$('.remove').click(function(){\n\t\t\$(this).parent('p').remove();\n\t});\n}\n");
Exemple #17
0
function plug_clock($p, $o)
{
    clock_head();
    $ret = balise('div', array('id' => 'clock'), '');
    //landmarkSub
    for ($i = 0; $i < 60; $i++) {
        $landmarkSub = balise('div', array('id' => 'landmarkSub'), '');
        $ret .= balise('div', array('id' => 'landmarkFrame', 'style' => 'transform: rotate(' . $i * 6 . 'deg);'), $landmarkSub);
    }
    //landmark
    for ($i = 0; $i < 12; $i++) {
        $landmark = balise('div', array('id' => 'landmark'), '');
        $ret .= balise('div', array('id' => 'landmarkFrame', 'style' => 'transform: rotate(' . $i * 30 . 'deg);'), $landmark);
        $hour = balise('div', array('id' => 'landmarkText', 'style' => 'transform: rotate(-' . $i * 30 . 'deg);'), $i ? $i : 12);
        $ret .= balise('div', array('id' => 'landmarkTextFrame', 'style' => 'transform: rotate(' . $i * 30 . 'deg) translate(0px, 0px);'), $hour);
    }
    $needleMin = balise('div', array('id' => 'needleHour'), ' ');
    $ret .= balise('div', array('id' => 'needleHourFrame'), $needleMin);
    $needleMin = balise('div', array('id' => 'needleMin'), ' ');
    $ret .= balise('div', array('id' => 'needleMinFrame'), $needleMin);
    $needleSec = balise('div', array('id' => 'needleSec'), ' ');
    $ret .= balise('div', array('id' => 'needleSecFrame'), $needleSec);
    $ret .= balise('div', array('id' => 'clockCenter'), '');
    $ret .= balise('div', array('id' => 'digit'), '');
    $ret .= js_code('clock();');
    $ret = balise('div', array('id' => 'clockFrame'), $ret);
    return $ret;
}
Exemple #18
0
$this->endWidget();
?>
	
<?php 
/**
* 字段类型 使用AJAX
* 数据库表名及字段名
*/
$rows = CDB('SHOW TABLES')->queryAll();
foreach ($rows as $v) {
    $mysql_table = ArrHelper::first($v);
    if (in_array($mysql_table, array('node_field', 'node_content'))) {
        continue;
    }
    $row = CDB("SHOW  COLUMNS FROM  {$mysql_table}")->queryAll();
    foreach ($row as $k) {
        $f = $k['Field'];
        if (!in_array($f, array('uid', 'created', 'id', 'updated', 'language_id', 'vid', 'sort', 'display')) && strpos($f, 'id') === false) {
            $ajax_str .= "'" . $mysql_table . '.' . $f . "',";
        }
    }
}
$ajax_str = substr($ajax_str, 0, -1);
/**
* ajax 自动完成的验证规则
*/
$ruels_default = "'required:1','length: min:3 max:12'";
js_code("\n\tfunction init_type(v){ \n\t\t\$.post('" . url('node/field/ajax') . "',{id:v},function(data){ \n\t\t\t\$('#ajax').html(data);\n\t\t\tjQuery('#NodeField_relation').autocomplete({'minLength':'1','source':[" . $ajax_str . "]});\n\t\t\t\n\t\t});\n\t}\n\tinit_type(\$('#NodeField_type').val());\n\t\$('#NodeField_type').change(function(){ \n\t\tinit_type( \$(this).val() );\n\t});\n\tjQuery('#NodeField_rules').autocomplete({'minLength':'1','source':[" . $ruels_default . "]});\n");
core_js('jquery.ui');
$cssCoreUrl = Yii::app()->getClientScript()->getCoreScriptUrl();
css($cssCoreUrl . '/jui/css/base/jquery-ui.css');
Exemple #19
0
    $dbquery = $db->query("INSERT INTO " . PREFIX . "_streams (title, service, login, description, pic) VALUES ('{$title}', '{$service}', '{$login}', '{$descr}', '{$pic}')");
    if ($dbquery) {
        $dle_api->clean_cache("stream-info");
        $dle_api->clean_cache("stream-info-block");
        msg("info", "Готово", "Трансляция успешно добавлена.", "?mod=stream-info&action=edit");
    } else {
        msg("error", "Ошибка", "Не удалось добавить трансляцию.", "?mod=stream-info&action=edit");
    }
} elseif ($act == 'edit') {
    /*===========================
      Редактирование трансляций
      ===========================*/
    $id = (int) $_REQUEST['id'];
    echoheader("<i class=\"icon-edit\"></i> Редактирование трансляций", "Редактирование трансляции сайта");
    echomenu();
    js_code();
    if (isset($id) && !empty($id)) {
        $stream = $db->super_query("SELECT id, title, login, service, description, pic, date FROM " . PREFIX . "_streams WHERE id = {$id}");
        opentable("Редактировать трансляцию");
        echo <<<HTML
<div class="box-content">
<form action="" method="POST" class="form-horizontal">
<div class="tab-content">
 <div class="tab-pane active">
    <div class="row box-section">

        <div class="form-group">
          <label class="control-label col-lg-2">Логин трансляции:</label>
          <div class="col-lg-10">
            <input id="login-stream" type="text" style="width:100%;max-width:437px;" name="edit[login]" value="{$stream['login']}" required><span class="help-button" data-rel="popover" data-trigger="hover" data-placement="right" data-content="Логин трансляции обязателен к заполнению и может содержать не более 100 символов." data-original-title="" title="">?</span>
          </div>
Exemple #20
0
function header_tags($r)
{
    $ret = '';
    if ($r) {
        foreach ($r as $k => $v) {
            if (is_array($v)) {
                $va = current($v);
            }
            switch (key($v)) {
                case 'code':
                    $ret .= $va . "\n";
                    break;
                case 'csslink':
                    $ret .= css_link($va);
                    break;
                case 'jslink':
                    $ret .= js_link($va);
                    break;
                case 'csscode':
                    $ret .= css_code($va);
                    break;
                case 'jscode':
                    $ret .= js_code($va);
                    break;
                case 'rel':
                    $ret .= '<link rel="' . $v['rel'][0] . '" href="' . $v['rel'][1] . '">' . "\n";
                    break;
                case 'meta':
                    $ret .= meta($va[0], $va[1], $va[2]);
                    break;
                case 'name':
                    $ret .= meta('name', $va[0], $va[1]);
                    break;
                case 'tag':
                    $ret .= bal($va[0], $va[1]);
                    break;
                default:
                    $ret .= meta(key($v), $va[0], $va[1]);
                    break;
            }
        }
    }
    return $ret;
}
Exemple #21
0
function plug_uclock($p, $o)
{
    //$rid='plg'.randid();
    //echo mktime(4,0,0,7,26,2003); //1059184800
    //echo mktime(4,0,0,7,9,2003); //1057716000
    uclock_head();
    //if($_GET['callj'])$head=Head::generate();
    $ret = balise('div', array('id' => 'clock'), '');
    //landmarkUiwSub
    for ($i = 0; $i < 60; $i++) {
        $landmarkSub = balise('div', array('id' => 'landmarkSub'), '');
        $ret .= balise('div', array('id' => 'landmarkFrame', 'style' => 'transform: rotate(' . $i * 6 . 'deg);'), $landmarkSub);
    }
    //landmarkUiw
    for ($i = 0; $i < 12; $i++) {
        $landmark = balise('div', array('id' => 'landmark'), '');
        $ret .= balise('div', array('id' => 'landmarkFrame', 'style' => 'transform: rotate(' . $i * 30 . 'deg);'), $landmark);
        //landmarkText
        $hour = balise('div', array('id' => 'landmarkText', 'style' => 'transform: rotate(-' . $i * 30 . 'deg);'), $i ? $i * 5 : 60);
        $ret .= balise('div', array('id' => 'landmarkTextFrame', 'style' => 'transform: rotate(' . $i * 30 . 'deg);'), $hour);
    }
    $needleXee = balise('div', array('id' => 'needleXee'), ' ');
    $ret .= balise('div', array('id' => 'needleXeeFrame'), $needleXee);
    $needleXsi = balise('div', array('id' => 'needleXsi'), ' ');
    $ret .= balise('div', array('id' => 'needleXsiFrame'), $needleXsi);
    $needleUiw = balise('div', array('id' => 'needleUiw'), ' ');
    $ret .= balise('div', array('id' => 'needleUiwFrame'), $needleUiw);
    $needleHour = balise('div', array('id' => 'needleHour'), ' ');
    $ret .= balise('div', array('id' => 'needleHourFrame'), $needleHour);
    $ret .= balise('div', array('id' => 'clockCenter'), '');
    //digit
    $digit = balise('span', array('id' => 'xee', 'class' => 'xeeColor'), '') . ' ';
    $digit .= balise('span', array('id' => 'xsi', 'class' => 'xsiColor'), '') . ' ';
    $digit .= balise('span', array('id' => 'uiw', 'class' => 'uiwColor'), '') . ' ';
    $digit .= balise('span', array('id' => 'uiwHour', 'class' => 'uiwHourColor'), '') . ' ';
    $ret .= balise('div', array('id' => 'digit'), 'Aeon 4 ' . $digit);
    $ret .= js_code('clock();');
    return $head . balise('div', array('id' => 'clockFrame'), $ret);
}
Exemple #22
0
//needed
$ret .= meta('name', 'hub', $_SESSION['qb']);
//$ret.=meta('name','copyright','GNU/GPLv3');
$ret .= meta('name', 'viewport', 'user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1, width=device-width');
//prmb(4)
$ret .= meta('name', 'google-site-verification', prms('goog'));
$ret .= css_link('/css/_global.css' . $cst);
//css
$ret .= css_link('/css/_pictos.css' . $cst);
//icons
if ($_GET['admin'] or $_GET['msql']) {
    $ret .= css_link('/css/_admin.css');
} else {
    $ret .= css_link('/css/' . $meta["css"] . '.css' . $cst);
}
$ret .= js_code('cutat=' . $_SESSION['jbuffer'] . '; fixpop="' . $_SESSION['mobile'] . '"; 
fulpop="1"; read="' . $read . '"; flow="' . $flow . '";');
$ret .= js_link('/prog' . $g . '/ajx.js');
//ajax
$ret .= js_link('/prog' . $g . '/utils.js');
//js
if (rstr(100)) {
    $ret .= js_link('http://code.jquery.com/jquery-1.9.1.min.js');
}
if ($_SESSION['desgn']) {
    $ret .= js_link('/js/live.js#css');
}
$ret .= Head::get();
$ret .= '</head>' . "\n";
if ($_GET['admin']) {
    $sp = ' spellcheck="false"';
}
Exemple #23
0
function plug_channel($p, $t, $d = 'articles')
{
    req('mod,art,spe');
    $_GET['call'] = '';
    //microxml
    $p = 'philum.org:site newworld:hub';
    if ($o) {
        $n = $o * 1000;
        $j = 'SaveD("chan_channel_' . $p . '_' . $t . '_' . $d . '");';
        $ret = js_code(temporize('channeltimer', $j, $n));
    }
    $ret .= divd('chan', channel($p, $t, $d));
    return $ret;
}
Exemple #24
0
<?php

/* @var $this Controller */
?>
<!DOCTYPE HTML>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />  
 	<?php 
css(theme_url() . '/css/style.css');
css(theme_url() . '/css/home.css');
core_js('jquery');
js(theme_url() . '/js/DD_belatedPNG0.0.8a-min.js');
js_code("fix", "DD_belatedPNG.fix('.pic, .china, .leftxin img');");
?>
 
 	<!--[if lt IE 9]>
	<script src="<?php 
echo base_url();
?>
/misc/html5shiv.js"></script>
	<![endif]-->
	<title><?php 
echo __('front site title');
?>
</title>
</head>

<body>
 
<div class="main">
Exemple #25
0
<!DOCTYPE HTML>
	<head> 
	<meta charset="utf-8">
  	<?php 
core_js('jquery');
css(base_url() . '/misc/bootstrap/css/bootstrap.min.css');
css_code("\n \t\t\t.label-default a{color:#fff;}\n \t\t\tlabel{display:block;}\n \t\t\t.label{color:black;}\n \t\t\t#acl label{margin-right:5px;}\n \t\t\t.bs-sidenav li.active  {\n\t\t\t\tfont-weight: bold;\n\t\t\t\tcolor: #563d7c;\n\t\t\t\tbackground-color: transparent;\n\t\t\t\tborder-right: 1px solid #563d7c;\n\t\t\t}\n\t\t\t.bs-sidenav{\n\t\t\t\tbackground:#eee;\n\t\t\t\tpadding: 10px;\n \n\t\t\t\tborder:1px solid #eee;\n\t\t\t\t \n\t\t\t\t-webkit-border-radius: 6px;\n\t\t\t\t-moz-border-radius: 6px;\n\t\t\t  \n\t\t\t}\n \t\t");
js(base_url() . '/misc/bootstrap/js/bootstrap.min.js');
js(base_url() . '/misc/php.js');
widget("imagesloaded", array('tag' => 'img'));
$lang = CDB()->from('languages')->where('is_default=1')->queryRow();
$select_id = $lang['id'];
js_code("\n      if(!\$('#AutoModel_language_id').val()){\n        \$('#AutoModel_language_id option').each(function(){\n           if(\$(this).val()== " . $select_id . "){\n            \$(this).attr('selected','selected');\n           }\n\n        });\n      }\n    ");
//	widget('select2');
?>
 
 	<!--[if lt IE 9]>
	<script src="<?php 
echo base_url();
?>
/misc/html5shiv.js"></script>
	<![endif]-->
	<title><?php 
echo __('admin panel');
?>
</title>
</head> 
<body> 
<div class="navbar navbar-default navbar-static-top" role="navigation">
  <div class="container">
    <div class="navbar-header">