Skip to content

Instantly share code, notes, and snippets.

curl --data "apikey : SECRETKEY" https://www.kimonolabs.com/kimonoapis/API/startcrawl
diff --git git/freistilbox.gitignore git/freistilbox.gitignore
index d97ad310030339e939adb897632410ce3d158092..0c90a74d1004585725cf52736ecd363a431cdc4d 100644
--- git/freistilbox.gitignore
+++ git/freistilbox.gitignore
@@ -12,6 +12,9 @@
/docroot/.htaccess
/docroot/.htpasswd
+# gitignore is managed in the global root, not in drupal
+/docroot/.gitignore
@Cyberschorsch
Cyberschorsch / gist:5264117
Last active December 15, 2015 12:59
Helper function for the module file
<?php
/**
* Helper to filter tids on given vocabularies.
*
* @param array $tids
* array of term ids
* @param array $vocabularies
* array of vocabulary machine names
*
* @return array
@Cyberschorsch
Cyberschorsch / gist:5264112
Created March 28, 2013 15:32
The get argument function
<?php
/**
* This function controls what to return to the contextual filter.
*/
function get_argument() {
// Get available flag types from the system.
$flags = flag_get_flags('taxonomy_term');
// Get all User flags.
$user_flags = flag_get_user_flags('taxonomy_term');
@Cyberschorsch
Cyberschorsch / gist:5264086
Created March 28, 2013 15:29
Submit Function
<?php
/**
* Provide the default form form for submitting options.
*/
function options_submit(&$form, &$form_state, &$options = array()) {
// We filter the options on only selected ones.
$options['flags'] = array_filter($options['flags']);
$options['vocabularies'] = array_filter($options['vocabularies']);
}
@Cyberschorsch
Cyberschorsch / gist:5264081
Created March 28, 2013 15:29
The option definition
<?php
/**
* Return all possible options for the view and provide default values.
*/
function option_definition() {
$options = parent::option_definition();
$options['flags'] = array('default' => array());
$options['vocabularies'] = array('default' => array());
$options['fallback'] = array('default' => 'all');
$options['multiple_operator'] = array('default' => '+');
@Cyberschorsch
Cyberschorsch / gist:5264059
Created March 28, 2013 15:27
Complete Option Form
<?php
/**
* Define the options form to enable selection of flags.
*/
function options_form(&$form, &$form_state) {
// Load all flags and types of each flag.
$flags = flag_get_flags('taxonomy_term');
// Combine all types (=vocabs) into one option array.
$flag_types = array();
@Cyberschorsch
Cyberschorsch / gist:5264049
Created March 28, 2013 15:26
Views Argument Handler default value for options
<?php
'#default_value' => $this->options['flags'],
?>
@Cyberschorsch
Cyberschorsch / gist:5264038
Created March 28, 2013 15:24
Views Argument Default Flag Handler - RAW
<?php
/**
* Define the options form to enable selection of flags.
*/
function options_form(&$form, &$form_state) {
}
/**
* Return all possible options for the view and provide default values.
@Cyberschorsch
Cyberschorsch / views_flag_context.views.inc.php
Last active December 15, 2015 12:59
hook_views_plugins().
<?php
/**
* Implements hook_views_plugins().
*/
function views_flag_context_views_plugins() {
$plugin = array(
'argument default' => array(
'views_argument_default_flag' => array(
'title' => t('Default Flags'),
'handler' => 'views_argument_default_flag',