Created
November 10, 2014 12:14
-
-
Save nsams/ad21e2a4f43e01fa0d5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ret['assets']['files'][] = new Vkwc_Statistics_Opt_ConfigAsset(); | |
<?php | |
class Vkwc_Statistics_Opt_ConfigAsset extends Kwf_Assets_Dependency_Abstract | |
{ | |
public function getMimeType() | |
{ | |
return 'text/javascript'; | |
} | |
public function getContents($language) | |
{ | |
$config = array(); | |
foreach (Kwf_Component_Abstract::getComponentClasses() as $cls) { | |
if (is_instance_of($cls, 'Kwc_Statistics_Opt_Component')) { | |
$config['optChangedUrl'] = Kwc_Admin::getInstance($cls)->getControllerUrl('OptChanged').'/json-opt-changed'; | |
break; | |
} | |
} | |
return 'Kwf.namespace(\'Kwc.Statistics.Opt\'); Kwc.Statistics.Opt.config = '.json_encode((object)$config).";\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment