This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Packs | |
module Admin | |
class Grade < Grade | |
# Stub class extending from the real definition | |
end | |
end # Admin | |
end # Packs | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEvent('domready',function(){ | |
if ($('section-menu')) { | |
$('section-menu').getElements('a.menuitem').each(function(n){ | |
n.addEvent('click',function(ev){ | |
new Event(ev).preventDefault(); | |
}) | |
}) | |
var accordion = new Accordion('a.menuitem', 'ul.submenu', { | |
opacity: false, | |
onActive: function(toggler, element){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- The cheater way --> | |
<a href="javascript:window.history.go(-2);">Go back 2 history</a> | |
<!-- The more correct way --> | |
<span id="go-back">Go back</span> | |
<script type="text/javascript"> | |
document.getElementById('go-back').onclick = function() { | |
window.history.go(-2); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Copyright (c) 2006-2009 Sam Collett (http://www.texotela.co.uk) | |
* Modified by Phil Schalm to allow custom sorting via a passed in function | |
* | |
*/ | |
$.fn.sortOptions = function(ascending) | |
{ | |
// get selected values first |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.sortOptions = function(ascending) | |
{ | |
var _sortFunc; | |
if ( typeof(ascending) == "function") { | |
_sortFunc = ascending; | |
} else if (!!ascending) { | |
_sortFunc = function(a,b) { | |
return a.text < b.text ? -1 : 1; | |
} | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DataMapper | |
class Query | |
alias :old_assert_valid_order :assert_valid_order | |
def assert_valid_order(order, fields) | |
old_assert_valid_order(order, fields) unless !order.nil? && order.any? { |p| p.is_a?(Direction) && p.property.name == :sort_order } | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all the properties that aren't fulltext (which will cause the query to break) | |
props = Product.properties.reject{|p| p.type == DataMapper::Types::Text }.map{|p| "`products`.`#{p.name}`" }.join(', ') | |
# Get categories before hand as it tends to be a little faster. | |
@categories = Category.all( :name.like => "%#{params[:search]}%" ) | |
# Do the massive query. | |
# You'll notice the << -1 on the queries. Since @category.id is an autoincrement it'll never be -1 and this is easier than a messey ternary statement. I'd imagine the messy statement could be a little faster, however. | |
@t_products = Product.find_by_sql(["SELECT " + props + " | |
FROM products | |
LEFT JOIN categories_products ON categories_products.product_id = products.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :admin do | |
resources :services | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#26907620 - About 10 minutes from the end. Phar mummies to SS ult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function add_field($code, $title, $side = 'full', $type = db_text, $just_column = false) | |
{ | |
$this->custom_columns[$code] = $type; | |
$this->_columns_def = null; | |
$col = $this->define_column($code, $title)->validation(); | |
if ( !$just_column ) { | |
$form_field = $this->add_form_field($code, $side)->optionsMethod('get_added_field_options'); | |
$this->added_fields[$code] = $form_field; | |
return $form_field; |
OlderNewer