60 $this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
61 $this->PageJS =
get_package(
'page::page_js' ,
'last' , __FILE__ );
62 $this->String =
get_package(
'string' ,
'last' , __FILE__ );
63 $this->Utilities =
get_package(
'utilities' ,
'last' , __FILE__ );
93 $Path =
"{http_host}/"._get_package_relative_path_ex(
'gui::button_markup' ,
'last' );
94 $this->PageJS->add_javascript(
"$Path/include/js/button_markup.js" );
132 $Settings->set_undefined(
'label' ,
'label' );
133 $Settings->set_undefined(
'size' ,
'42' );
134 $Settings->set_undefined(
'package_version' ,
'last' );
136 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'component_button.tpl' );
137 $Code = $this->String->print_record( $Code ,
$Settings->get_raw_settings() );
139 $Path = $this->Utilities->get_package_path(
$Settings );
141 $Icon =
$Settings->get_setting(
'icon' );
142 $Code = str_replace(
'{path_to_image}' ,
"$Path/res/images/$Icon" , $Code );
146 catch( Exception $e )
170 private function set_default_data_for_toolbar_button( &
$Settings )
174 $Settings->set_undefined(
'title' ,
'' );
176 $Settings->set_undefined(
'permit' ,
'admin' );
177 $Settings->set_undefined(
'package_version' ,
'last' );
178 $Settings->set_undefined(
'page' ,
'javascript:void(0);' );
180 $OnClick =
$Settings->get_setting(
'onclick' ,
false );
181 if( $OnClick ===
false )
183 $Settings->set_setting(
'onclick' ,
'' );
187 $Settings->set_setting(
'onclick' ,
'onclick="'.$OnClick.
'" ' );
190 catch( Exception $e )
222 $this->set_default_data_for_toolbar_button(
$Settings );
224 $Icon =
$Settings->get_setting(
'icon' );
226 $Path = $this->Utilities->get_package_path(
$Settings );
228 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'menu_button.tpl' );
230 $Code = $this->String->print_record( $Code ,
$Settings->get_raw_settings() );
232 return( str_replace(
'{path_to_image}' ,
"$Path/res/images/$Icon" , $Code ) );
234 catch( Exception $e )
266 $this->set_default_data_for_toolbar_button(
$Settings );
268 $Icon =
$Settings->get_setting(
'icon' );
270 $Path = $this->Utilities->get_package_path(
$Settings );
272 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'toolbar_button.tpl' );
273 $Code = $this->String->print_record( $Code ,
$Settings->get_raw_settings() );
274 $Code = str_replace(
'{path_to_image}' ,
"$Path/res/images/$Icon" , $Code );
278 catch( Exception $e )
310 private function set_toggle_button_icons( $Code , &
$Settings )
314 $Path = $this->Utilities->get_package_path(
$Settings );
316 $Value =
$Settings->get_setting(
'value' , 0 );
317 $Icon =
$Settings->get_setting( $Value ?
'icon' :
'icon_toggle' );
318 $IconToggle =
$Settings->get_setting( $Value ?
'icon_toggle' :
'icon' );
320 $ToggleFunc =
$Settings->get_setting(
'toggle_func' );
322 $Func =
"ultimix.button_markup.ToggleButton( this , '$Icon' , '$IconToggle' , $ToggleFunc );";
324 array(
'{path_to_image}' ,
'{func}' ,
'{icon}' ,
'{icon_toggle}' ) ,
325 array(
"$Path/res/images/$Icon" , $Func , $Icon , $IconToggle ) , $Code
330 catch( Exception $e )
362 $this->set_default_data_for_toolbar_button(
$Settings );
364 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'toggle_button.tpl' );
365 $Code = $this->String->print_record( $Code ,
$Settings->get_raw_settings() );
367 $Code = $this->set_toggle_button_icons( $Code ,
$Settings );
371 catch( Exception $e )
404 $this->set_default_data_for_toolbar_button(
$Settings );
406 $Code = $this->CachedMultyFS->get_template( __FILE__ ,
'run_controller_and_remove_dom_button.tpl' );
408 $Code = $this->String->print_record( $Code ,
$Settings->get_raw_settings() );
410 $Path = $this->Utilities->get_package_path(
$Settings );
412 $Code = str_replace(
'{path_to_image}' , $Path.
"/res/images/$Icon" , $Code );
416 catch( Exception $e )