def get_placeholder_conf(setting, placeholder, template=None, default=None):
 if placeholder:
  keys = []
  placeholder_conf = get_cms_setting('PLACEHOLDER_CONF')
  if template:
   keys.append((u'%s %s' % (template, placeholder)))
  keys.append(placeholder)
  if template:
   keys.append(template)
  keys.append(None)
  for key in keys:
   for (conf_key, conf) in placeholder_conf.items():
    if (force_text(conf_key) == force_text(key)):
     if (not conf):
      continue
     value = conf.get(setting)
     if (value is not None):
      return value
     inherit = conf.get('inherit')
     if inherit:
      if (' ' in inherit):
       inherit = inherit.split(' ')
      else:
       inherit = (None, inherit)
      value = get_placeholder_conf(setting, inherit[1], inherit[0], default)
      if (value is not None):
       return value
 return default

def get_placeholder_conf ( setting , placeholder , template = None , default = None ) : if placeholder : keys = [ ] placeholder_conf = get_cms_setting ( 'PLACEHOLDER_CONF' ) if template : keys . append ( ( u'%s %s' % ( template , placeholder ) ) ) keys . append ( placeholder ) if template : keys . append ( template ) keys . append ( None ) for key in keys : for ( conf_key , conf ) in placeholder_conf . items ( ) : if ( force_text ( conf_key ) == force_text ( key ) ) : if ( not conf ) : continue value = conf . get ( setting ) if ( value is not None ) : return value inherit = conf . get ( 'inherit' ) if inherit : if ( ' ' in inherit ) : inherit = inherit . split ( ' ' ) else : inherit = ( None , inherit ) value = get_placeholder_conf ( setting , inherit [ 1 ] , inherit [ 0 ] , default ) if ( value is not None ) : return value return default
returns the placeholder configuration for a given setting .