Skip to content

Instantly share code, notes, and snippets.

View sevein's full-sized avatar

Jesús García Crespo sevein

View GitHub Profile
@sevein
sevein / upload.html
Created March 31, 2011 23:28
Post a form to upload action like yui uploader does in ICA-AtoM
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="http://localhost/ica-atom/qubit_dev.php/;digitalobject/upload" enctype="multipart/form-data">
<p>Information Object ID:</p>
<input type="text" name="informationObjectId" value="" />
<p>File:</p>
<input type="file" name="file" />
@sevein
sevein / editAction.class.php.diff
Created April 15, 2011 13:37
$this-relation was being used in other context, I created new properties "thematicAreaRelations" and "geographicRegionRelations"
--- editAction.usask.class.php 2011-04-15 15:34:34.168164792 +0200
+++ editAction.class.php 2011-04-15 15:32:01.982147000 +0200
@@ -102,7 +102,7 @@
$criteria->add(QubitTerm::TAXONOMY_ID, QubitTaxonomy::THEMATIC_AREA_ID);
$value = array();
- foreach ($this->relations = QubitObjectTermRelation::get($criteria) as $item)
+ foreach ($this->thematicAreaRelations = QubitObjectTermRelation::get($criteria) as $item)
{
$value[] = $this->context->routing->generate(null, array($item->term, 'module' => 'term'));
@sevein
sevein / QubitInformationObject.php.diff
Created April 20, 2011 15:19
cast $value as an array
Index: lib/model/QubitInformationObject.php
===================================================================
--- lib/model/QubitInformationObject.php (revision 9051)
+++ lib/model/QubitInformationObject.php (working copy)
@@ -127,7 +127,7 @@
}
}
- $this->values[$name]->__set('value', serialize($value), $options + array('sourceCulture' => true));
+ $this->values[$name]->__set('value', serialize((array)$value), $options + array('sourceCulture' => true));
@sevein
sevein / cache_qubit_settings.patch
Created June 14, 2011 05:44
Use sfFileCache to cache Qubit settings
Index: lib/SiteSettingsFilter.class.php
===================================================================
--- lib/SiteSettingsFilter.class.php (revision 9157)
+++ lib/SiteSettingsFilter.class.php (working copy)
@@ -20,30 +20,29 @@
class siteSettingsFilter extends sfFilter
{
/*
- * execute this filter on every request in case some params have changed since the last page load
+ * Execute this filter on every request in case some params have changed since the last page load
@sevein
sevein / search-module-changes.patch
Created October 13, 2011 22:41
search module changes
Index: apps/qubit/modules/search/actions/indexAction.class.php
===================================================================
--- apps/qubit/modules/search/actions/indexAction.class.php (revision 10078)
+++ apps/qubit/modules/search/actions/indexAction.class.php (working copy)
@@ -29,18 +29,20 @@
$request->limit = sfConfig::get('app_hits_per_page');
}
- // limit search to current culture and info. objects
+ // Limit search to current culture and info. objects
@sevein
sevein / index.html
Created November 6, 2011 22:48
Two lists of items
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Exercice 2</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://documentcloud.github.com/underscore/underscore.js"></script>
<script type="text/javascript" src="http://documentcloud.github.com/backbone/backbone.js"></script>
@sevein
sevein / patch.diff
Created November 7, 2011 20:25
Accession plugin as an optional plugin
Index: config/ProjectConfiguration.class.php
===================================================================
--- config/ProjectConfiguration.class.php (revision 10255)
+++ config/ProjectConfiguration.class.php (working copy)
@@ -26,7 +26,6 @@
{
$this->enablePlugins(array(
'qbAclPlugin',
- 'qtAccessionPlugin',
'sfAuditPlugin',
@sevein
sevein / 404.patch
Created November 9, 2011 21:51
Workaround for qubit 1.2 to fix app error when 404 is shown
Index: apps/qubit/config/routing.yml
===================================================================
--- apps/qubit/config/routing.yml (revision 10293)
+++ apps/qubit/config/routing.yml (working copy)
@@ -15,7 +15,6 @@
param:
module: qtSwordPlugin
slug: { pattern: '[^;]+' }
- throw404: false
@sevein
sevein / gist:1377480
Created November 18, 2011 19:22
Remove cache
Index: apps/qubit/modules/menu/actions/listAction.class.php
===================================================================
--- apps/qubit/modules/menu/actions/listAction.class.php (revision 10336)
+++ apps/qubit/modules/menu/actions/listAction.class.php (working copy)
@@ -44,8 +44,8 @@
// Remove cache
if ($this->context->getViewCacheManager() !== null)
{
- $this->context->getViewCacheManager()->remove('@sf_cache_partial?module=menu&action=_browseMenu&sf_cache_key=settings');
@sevein
sevein / .htaccess
Created November 22, 2011 06:15
Qubit htaccess example file
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
RewriteBase /foobar
# we skip all files with .something