sudo apt-get install recode
find . -name "*.php" -print0|xargs -0 recode windows1251..utf8
find . -name "*.php" -print0|xargs -0 recode windows1251..utf8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <VirtualHost *:80> ServerName biznes.loc DocumentRoot /home/user/www/bitrix_biznes <Directory /home/user/www/bitrix_biznes> Options FollowSymLinks AllowOverride ALL </Directory> <IfModule mod_php5.c> php_value default_charset utf-8 php_admin_value mbstring.func_overload 2 php_value mbstring.internal_encoding utf-8 php_admin_value realpath_cache_size "4096k" </IfModule> </VirtualHost> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <? if (!defined( "B_PROLOG_INCLUDED" ) || B_PROLOG_INCLUDED!==true) die (); $properties = CIBlockProperty::GetList(Array( "sort" => "asc" , "name" => "asc" ), Array( "ACTIVE" => "Y" , "IBLOCK_ID" => $arCurrentValues [ "IBLOCK_ID" ])); while ( $prop_fields = $properties ->GetNext()){ $elements [ $prop_fields [ "ID" ]]= $prop_fields [ "NAME" ]; } $arTemplateParameters = array ( "PROPERTY_ADRESS" => Array( "NAME" => GetMessage( "T_PROPERTY_ADRESS" ), "TYPE" => "LIST" , "VALUES" => $elements , "REFRESH" => "Y" , ), "PROPERTY_PHONE" => Array( "NAME" => GetMessage( "T_PROPERTY_PHONE" ), "TYPE" => "LIST" , "VALUES" => $elements , "REFRESH" => "Y" , ), "PROPERTY_FAX" => Array( "NAME" => GetMessage( "T_PROPERTY_FAX" ), "TYPE" => "LIST" , "VALUES" => $elements , "REFRESH" => "Y" , ), "PROPERTY_EMAIL" => Array( "NAME" => GetMessage( "T_PROPERTY_EMAIL" ), "TYPE" => "LIST" , "VALUES" => $elements , "REFRESH" => "Y" , ), ); ?> |
1 2 3 4 5 6 | <? $MESS [ "T_PROPERTY_ADRESS" ] = "Свойства адреса" ; $MESS [ "T_PROPERTY_PHONE" ] = "Свойства телефон" ; $MESS [ "T_PROPERTY_FAX" ] = "Свойства факса" ; $MESS [ "T_PROPERTY_EMAIL" ] = "Свойства Email" ; ?> |
1 2 3 4 5 6 | <? $MESS [ "T_PROPERTY_ADRESS" ] = "property adress" ; $MESS [ "T_PROPERTY_PHONE" ] = "proropery phone" ; $MESS [ "T_PROPERTY_FAX" ] = "property fax" ; $MESS [ "T_PROPERTY_EMAIL" ] = "property Email" ; ?> |
1 2 3 4 5 6 | < VirtualHost *:80> ServerName redmine.loc DocumentRoot "/usr/share/redmine/public" PassengerResolveSymlinksInDocumentRoot on Options Indexes ExecCGI FollowSymLinks </ VirtualHost > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | class Singleton { protected static $instance ; private function __construct() { } private function __clone() { } private function __wakeup() { } public static function getInstance() { if ( is_null (self:: $instance ) ) { self:: $instance = new self; } return self:: $instance ; } public function method() { //вумный код; } } Singleton::getInstance()->method(); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | if (!defined( "B_PROLOG_INCLUDED" ) || B_PROLOG_INCLUDED!==true) die (); IncludeTemplateLangFile( __FILE__ ); /** * благодоря данному подходу можно создавать не только пустой шаблон но и обертывать код например наример различным кодом окон * Class get_sub_themes_singleton */ class get_sub_themes_singleton { protected static $instance ; // object instance private $list_theme ; private $sub_theme ; private $dir_sub_theme ; private $params ; private function __construct(){} private function __clone(){} private function __wakeup(){} public static function getInstance() { if ( is_null (self:: $instance )) { self:: $instance = new get_sub_themes_singleton; } return self:: $instance ; } public function set_sub_theme( $sub_theme ){ //поставить при повышенных требованиях к безопасности if (! empty ( $this ->list_theme) && ! empty ( $this ->list_theme[ $sub_theme ])){ $this ->sub_theme = $this ->list_theme[ $sub_theme ]; } return self:: $instance ; } public function set_dir_sub_theme( $dir_sub_theme ){ if ( is_dir ( $dir_sub_theme )){ $this ->dir_sub_theme = $dir_sub_theme ; } else { die ( "not found sub themes" ); } return self:: $instance ; } public function set_list_theme( $list_theme ){ $this ->list_theme = $list_theme ; return self:: $instance ; } public function get_header(){ //include(""); //echo $this->sub_theme; if ( file_exists ( $this ->dir_sub_theme. $this ->sub_theme. "/header.php" )){ include_once ( $this ->dir_sub_theme. $this ->sub_theme. "/header.php" ); } } public function get_footer(){ if ( file_exists ( $this ->dir_sub_theme. $this ->sub_theme. "/footer.php" )){ include ( $this ->dir_sub_theme. $this ->sub_theme. "/footer.php" ); } } public function set_params( $key , $value ){ $this ->params[ $key ]= $value ; return self:: $instance ; } public function get_params( $key ){ return $this ->params[ $key ]; } public function theme_exists( $theme ){ if (! empty ( $this ->list_theme[ $theme ])){ return true; } else { return false; } } } /////////////////////////////////////////////////////////////////////////// get_sub_themes_singleton::getInstance() ->set_dir_sub_theme(dirname( __FILE__ ). "/sub_themes/" ) ->set_list_theme( array ( "full_html" => "full_html" , "work_arena" => "work_arena" , "simple_windows" => "simple_windows" , ))->set_sub_theme( "full_html" ); //подключаем тему из url //хотя можно поставить и в куках if (! empty ( $_REQUEST [ 'theme' ]) && get_sub_themes_singleton::getInstance()->theme_exists( $_REQUEST [ 'theme' ])){ get_sub_themes_singleton::getInstance()->set_sub_theme( $_REQUEST [ 'theme' ]); } get_sub_themes_singleton::getInstance()->get_header(); |
1 | get_sub_themes_singleton::getInstance()->get_footer(); |
1 2 3 4 5 6 | < div class = "parking_zone" closeajax = ".parking_zone" closebind = "click" > </ div > </ body > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | < script type = "text/javascript" > /** * превращаем обычные ссылки в ajax */ $(function(){ $(".ajax_link").live("click",function(){ var parking_zone=$(this).attr("parking_zone"); var close_element_control=$(parking_zone).attr("closeajax"); var action_close=$(parking_zone).attr("closebind"); $(close_element_control).bind(action_close, function(){ $(parking_zone).hide(); }); $(parking_zone).load($(".ajax_link").attr("ajaxhref"), function() { $(parking_zone).show();//настройка анимации окон }); return false; }); }); </ script > |
1 2 3 4 5 6 7 | <span class = "region-select-a" > <a id = "testid" class = "ajax_link" href= "/vibor_regiona/" ajaxhref= "/vibor_regiona/?ajax=Y&theme=simple_windows&<?=(empty($_REQUEST['параметр'])?" ":'region_geo_location='.$_REQUEST['параметр']);?>" parking_zone= ".parking_zone" >blabla</a></span> |