+ else: return self.classname in DEBUG
+
+ def setting_json (self, setting):
+ # TMP: js world expects plugin_uuid
+ if setting=='plugin_uuid':
+ value=self.domid
+ elif setting=='query_uuid':
+ try: value=self.query.uuid
+ except: return '%s:"undefined"'%setting
+ else:
+ value=getattr(self,setting,None)
+ if not value: value = "unknown-setting-%s"%setting
+ # first try to use to_json method (json.dumps not working on class instances)
+ try: value_json=value.to_json()
+ except: value_json=json.dumps(value,separators=(',',':'))
+ return "%s:%s"%(setting,value_json)
+
+ # expose in json format to js the list of fields as described in json_settings_list()
+ # and add plugin_uuid: domid in the mix
+ # NOTE this plugin_uuid thing might occur in js files from joomla/js, ** do not rename **
+ def settings_json (self):
+ result = "{"
+ result += "plugin_uuid:%s,"%self.domid
+ result += ",".join([ self.setting_json(setting) for setting in self.json_settings_list() ])
+ result += "}"
+ return result