Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----------------------
- // -- class A
- $strId = 'id_1234';
- $strClass = 'classname';
- $arParams = array('pluginid' => 'monitor', 'title' => 'Monitor', ...);
- $strClone = 'openForm(desktop(),"'.$strId.'","'.$strClass.'",'.$arParams.');';
- $this->menu = array( "clone" => $strClone, ... );
- // ----------------------
- // -- class B
- // loop through $this->menu, then..
- {
- eval( $this->menu[$item] );
- }
- // ----------------------
- // -- class C
- function openForm( $owner, $id, $class, $params )
- {
- ...
- }
- $ar = array('a' => 'value1', 'b' => 'value2');
- $str = "something";
- $run = " a('".$str."', $ar); "; // this line may be changed
- // this is done to represent the loss of the variables in another class
- unset($ar);
- unset($str);
- // $run is kept
- eval( $run );
- function a($str, $ar) {
- echo "$str=" . $str . "<br>";
- echo "$ar['a']=" . $ar['a'] . "<br>";
- echo "$ar['b']=" . $ar['b'] . "<br>";
- }
- $run = " a('".$str."', $ar); ";
- $run = " a('$str', ". var_export($ar, true) ."); ";
- a('something', array(
- 'a' => 'value1',
- 'b' => 'value2',
- ));
- $arParams = 'array("pluginid" => "monitor", "title" => "Monitor", ...)';
- $strParams = " array(";
- foreach($arParams as $strKey => $strVal) {
- $strParams .= "'".$strKey."' => '".$strVal."',";
- }
- $strParams = substr($strParams, 0, -1) . ") ";
- // later on
- ... => " openForm(desktop(),'".$strId."','".$strClass."',".$strParams."); "
Add Comment
Please, Sign In to add comment