Skip to content

Instantly share code, notes, and snippets.

View kidsil's full-sized avatar

Asaf Zamir kidsil

View GitHub Profile
test test test
RewriteEngine On
RewriteBase /sfproject/web/
DirectoryIndex index.php
RewriteRule .* /web/index.php/$0 [PT]
RewriteRule ^(?:sf)\b.* /home/sfproject/lib/vendor/symfony/data/web/sf/$0 [L]
//Add this at the start of preprocess_page to add a JS when you ADD or EDIT a certain content type.
if (arg(0) == 'node' && ((arg(1) == 'add' && arg(2) == 'contenttype') || ($vars['node']->type == 'contenttype' && arg(2) == 'edit'))) {
// Add your js file as usual
drupal_add_js('YOURJAVASCRIPT', 'theme');
$vars['scripts'] = drupal_get_js();
// Ensure that the addition has any effect by repopulating the scripts variable
}
drupal_add_js('misc/jquery.urlParser-1.0.0.js', 'theme');
drupal_add_js('misc/ultimatetable.js', 'theme');
$vars['scripts'] = drupal_get_js();
$thisNode = $element['#node'];
//Finding the Key the Product1 is in
$product1Key = 0;
foreach ($header as $key=>$item) {
if (preg_match('/.*Product1.*/',$item)) {
$product1Key = $key;
}
}
$j=1;
$hatedstuff = array('Kohana','Mongo','CenterPiece');
foreach ($hatedstuff as $item) {
echo 'I Hate '. $item;
}
$this->template->styles = array_merge($this->template->styles, ui::styles('dropdownchecklist'));
$this->template->scripts = array_merge($this->template->scripts, ui::scripts('dropdownchecklist'));
$hated = array('Kohana','MongoDB','CenterPiece');
foreach($hated as $item) {
echo 'I hate '.$item;
}
$(msg).find('#node-tablefield-0 table')
contents of msg:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Create Ultimate Five Table | </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="/ultimatefive.com/themes/acquia_slate/favicon.ico" type="image/x-icon" /> <link type="text/css" rel="stylesheet" media="all" href="/ultimatefive.com/modules/cck/theme/content-module.css?E" /> <link type="text/css" rel="stylesheet" media="all" href="/ultimatefive.com/modules/ctools/css/ctools.css?E" /> <link type="text/css" rel="stylesheet" media="all" href="/ultimatefive.com/modules/node/node.css?E" /> <link type="text/css" rel="stylesheet" media="all" href="/ultimatefive.com/modules/panels/css/panels.css?E" /> <link type="text/css" rel="stylesheet"
@kidsil
kidsil / Drupal-CCK-TableField-Ajax
Created June 23, 2010 21:11
Ajax Call for Drupal CCK Table Field
/*
* Copyright (c) 2010 Asaf Zamir
* All rights reserved.
*
*Redistribution and use in source and binary forms, with or without
*modification, are permitted provided that the following conditions
*are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.