Adds a set of default, standard bbcode definitions commonly used across the web.
17161
public function loadDefaultCodes() {
        $this->addBBCode("b", "<strong>{param}</strong>");
        $this->addBBCode("i", "<em>{param}</em>");
        $this->addBBCode("u", "<u>{param}</u>");
        $this->addBBCode("url", "<a href=\"{param}\">{param}</a>");
        $this->addBBCode("url", "<a href=\"{option}\">{param}</a>", true);
        $this->addBBCode("img", "<img src=\"{param}\" alt=\"a user uploaded image\" />");
        $this->addBBCode("img", "<img src=\"{param}\" alt=\"{option}\" />", true);
        $this->addBBCode("color", "<span style=\"color: {option}\">{param}</span>", true);
    }
982722
def _add_standard_attributes(cls):
        
        setattr(
            cls.context.new_class,
            cls.context.new_meta['state_attribute_name'],
            cls.context.state_value)
        setattr(
            cls.context.new_class,
            cls.context.state_name,
            utils.state_property)

        setattr(cls.context.new_class, 'is_', utils.is_)
        setattr(cls.context.new_class, 'can_be_', utils.can_be_)
        setattr(cls.context.new_class, 'set_', utils.set_)
240905
public MethodInfo addDefaultConstructor() {
        MethodInfo mi = addConstructor(Modifiers.PUBLIC, null);
        CodeBuilder builder = new CodeBuilder(mi);
        builder.loadThis();
        builder.invokeSuperConstructor(null);
        builder.returnVoid();
        return mi;
    }
1179537
private void addExternalResourceTags(StringBuffer sb, CmsContentDefinition definition) {

        Set<String> includedScripts = new HashSet<String>();
        Set<String> includedStyles = new HashSet<String>();
        for (CmsExternalWidgetConfiguration configuration : definition.getExternalWidgetConfigurations()) {
            for (String css : configuration.getCssResourceLinks()) {
                // avoid including the same resource twice
                if (!includedStyles.contains(css)) {
                    sb.append("<link type=\"text/css\" rel=\"stylesheet\" href=\"").append(css).append("\"></link>");
                    includedStyles.add(css);
                }
            }
            for (String script : configuration.getJavaScriptResourceLinks()) {
                // avoid including the same resource twice
                if (!includedScripts.contains(script)) {
                    sb.append("<script type=\"text/javascript\" src=\"").append(script).append("\"></script>");
                    includedScripts.add(script);
                }
            }
        }
    }
1048386
protected function setupDefaults()
    {
        $this->addTransformer('html', function ($value) {
            return new Markup($value, 'UTF-8');
        });
        $this->addTransformer('text', function ($value) {
            return new Markup($value, 'UTF-8');
        });
        $this->addTransformer('textarea', function ($value) {
            return new Markup($value, 'UTF-8');
        });
        $this->addTransformer('markdown', function ($value) {
            $markdown = new ParsedownExtra();
            $value = $markdown->text($value);

            return new Markup($value, 'UTF-8');
        });

        $this->addTransformer('repeater', function ($value) {
            /** @var FieldCollection $collection */
            foreach ($value as $collection) {
                foreach ($collection as $field) {
                    $field->setValue($this->transform($field->getValue(), $field->getFieldType()));
                }
            }

            return $value;
        });

        $this->addTransformer('block', function ($value) {
            return $this->transform($value, 'repeater');
        });
    }
762171
protected void addReturnType(MethodDoc method, Content htmltree) {
        Type type = method.returnType();
        if (type != null) {
            Content linkContent = writer.getLink(
                    new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type));
            htmltree.addContent(linkContent);
            htmltree.addContent(writer.getSpace());
        }
    }
630252
public MethodInfo addDefaultConstructor() {
        Modifiers modifiers = new Modifiers();
        modifiers.setPublic(true);
        MethodInfo mi = addConstructor(modifiers, null, null);
        CodeBuilder builder = new CodeBuilder(mi);
        builder.loadThis();
        builder.invokeSuperConstructor();
        builder.returnVoid();
        return mi;
    }
989170
protected void registerDefaults() {
        register(Long.class, new LongConverter());
        register(Integer.class, new IntegerConverter());
        register(Short.class, new ShortConverter());
        register(Byte.class, new ByteConverter());
        register(Double.class, new DoubleConverter());
        register(Float.class, new FloatConverter());
        register(Character.class, new CharacterConverter());
        register(Boolean.class, new BooleanConverter());

        register(String.class, new StringConverter());
        register(URL.class, new UrlConverter());
        register(URI.class, new UriConverter());
        register(Charset.class, new CharsetConverter());
        register(File.class, new FileConverter());
        register(Path.class, new PathConverter());
        register(Locale.class, new LocaleConverter());
        register(Pattern.class, new PatternConverter());

        register(Long.TYPE, new LongConverter());
        register(Integer.TYPE, new IntegerConverter());
        register(Short.TYPE, new ShortConverter());
        register(Byte.TYPE, new ByteConverter());
        register(Character.TYPE, new CharacterConverter());
        register(Double.TYPE, new DoubleConverter());
        register(Float.TYPE, new FloatConverter());
        register(Boolean.TYPE, new BooleanConverter());
    }
410657
private static void addDefaultEqualsMethod(ClassWriter cw, String implClassName)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, INDENT + "adding method : equals (Ljava/lang/Object;)Z");

        // -----------------------------------------------------------------------
        // public boolean equals(Object other)
        // {
        // -----------------------------------------------------------------------
        final String desc = "(Ljava/lang/Object;)Z";
        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "equals", desc, null, null);
        GeneratorAdapter mg = new GeneratorAdapter(mv, ACC_PUBLIC, "equals", desc);
        mg.visitCode();

        // -----------------------------------------------------------------------
        //    return this == other;
        // -----------------------------------------------------------------------
        mg.loadThis();
        mg.loadArg(0);
        Label not_equal = new Label();
        mv.visitJumpInsn(IF_ACMPNE, not_equal);
        mg.visitInsn(ICONST_1);
        mg.returnValue();

        mg.visitLabel(not_equal);
        mg.visitInsn(ICONST_0);
        mg.returnValue();

        // -----------------------------------------------------------------------
        // }
        // -----------------------------------------------------------------------
        mg.endMethod();
        mg.visitEnd();
    }
239619
def add(self, text="", default_continuousAdd=True):
		""""""
		if not text and default_continuousAdd:
			self.continuousAdd()
		else:
			pprefix = ""
			for x,y in self.rdflib_graph.namespaces():
				pprefix += "@prefix %s: <%s> . \n" % (x, y)
			# add final . if missing
			if text and (not text.strip().endswith(".")):
				text += " ."
			# smart replacements
			text = text.replace(" sub ", " rdfs:subClassOf ")
			text = text.replace(" class ", " owl:Class ")
			# finally
			self.rdflib_graph.parse(data=pprefix+text, format="turtle")
660425
protected function setDefaultFieldDefinitions() : void
    {
        $table = $this->config->getTable();
        $field = $this->config->getField();
        $dbFieldType = $this->getDbFieldType();

        // set $options['fieldDefinitions']
        $stubFields = [
            $field => [
                'name' => $field,
                'type' => $dbFieldType,
            ],
        ];
        if ($table instanceof HasFieldsInterface) {
            $fieldDefinitions = $table->getFieldsDefinitions($stubFields);
            $this->defaultOptions['fieldDefinitions'] = new CsvField($fieldDefinitions[$field]);
        }

        // This should never be the case, except, maybe
        // for some unit test runs or custom non-CSV
        // modules.
        if (empty($this->defaultOptions['fieldDefinitions'])) {
            $this->defaultOptions['fieldDefinitions'] = new CsvField($stubFields[$field]);
        }
    }
125993
protected function plugin_extend_coursemodule_standard_elements() {
        $callbacks = get_plugins_with_function('coursemodule_standard_elements', 'lib.php');
        foreach ($callbacks as $type => $plugins) {
            foreach ($plugins as $plugin => $pluginfunction) {
                // We have exposed all the important properties with public getters - and the callback can manipulate the mform
                // directly.
                $pluginfunction($this, $this->_form);
            }
        }
    }
856954
function (defaultSettings) {
        var baseUrl, suffix;

        baseUrl = defaultSettings.base_url;
        if (baseUrl) {
          this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, ''));
          this.baseURI = new URI(this.baseURL);
        }

        suffix = defaultSettings.suffix;
        if (defaultSettings.suffix) {
          this.suffix = suffix;
        }

        this.defaultSettings = defaultSettings;

        var pluginBaseUrls = defaultSettings.plugin_base_urls;
        for (var name in pluginBaseUrls) {
          AddOnManager.PluginManager.urls[name] = pluginBaseUrls[name];
        }
      }
256706
public function loadDefaults()
  {
    $this->addSe('*.google.*', 'q');
    $this->addSe('*.yahoo.*', 'p');
    $this->addSe('*.live.*', 'q');
    $this->addSe('*.bing.*', 'q');
    $this->addSe('*.aolsvc.*', 'q');
    $this->addSe('suche.webfan.de', 'q');
  }
648896
def add_definition(option, name, type, block, **opts)
      opts = {
        parent: extended_class,
        option: option,
        null:   null,
        source: name,
        type:   type,
        block:  block,
        **opts,
      }

      options = Dispatchers.call(opts)
      definition = Definition.new(options)
      definitions[definition.source] = definition
      finalize
      mixin.class_eval definition.code
    end
103169
def add_meta(self, obj, tags, prompt, verbosity, old_url=None):
        
        for tag in tags:
            keyword = self.trunc(Keyword, prompt, title=tag)
            keyword, created = Keyword.objects.get_or_create_iexact(**keyword)
            obj.keywords.create(keyword=keyword)
            if created and verbosity >= 1:
                print("Imported tag: %s" % keyword)
        if old_url is not None:
            old_path = urlparse(old_url).path
            if not old_path.strip("/"):
                return
            redirect = self.trunc(Redirect, prompt, old_path=old_path)
            redirect['site'] = Site.objects.get_current()
            redirect, created = Redirect.objects.get_or_create(**redirect)
            redirect.new_path = obj.get_absolute_url()
            redirect.save()
            if created and verbosity >= 1:
                print("Created redirect for: %s" % old_url)
1212895
protected function add_defaults() {
        $mform =& $this->_form;
        $strrequired = get_string('required');

        $mform->addElement('hidden', 'edit',  ($this->instance) ? $this->instance->id : 0);
        $mform->setType('edit', PARAM_INT);
        $mform->addElement('hidden', 'new',   $this->plugin);
        $mform->setType('new', PARAM_ALPHANUMEXT);
        $mform->addElement('hidden', 'plugin', $this->plugin);
        $mform->setType('plugin', PARAM_PLUGIN);
        $mform->addElement('hidden', 'typeid', $this->typeid);
        $mform->setType('typeid', PARAM_INT);
        $mform->addElement('hidden', 'contextid', $this->contextid);
        $mform->setType('contextid', PARAM_INT);

        $mform->addElement('text', 'name', get_string('name'), 'maxlength="100" size="30"');
        $mform->addRule('name', $strrequired, 'required', null, 'client');
        $mform->setType('name', PARAM_TEXT);
    }