Ejemplo n.º 1
0
	/**
	 * Template accessor to determine if sorting is enabled
	 *
	 * @return boolean
	 */
	public function Sortable() {
		if(!self::$backend) return false;
		return class_exists("SortableDataObject") && SortableDataObject::is_sortable_class("File");
	}
	array(
		'None' => "fx:'none'",
		'Fade over' => "fx:'fade'",
		'Fade in / out' => "sync:0,fx:'fade'",
		'Scroll horizontal' => "fx:'scrollHorz',easing:'easeOutQuart'",
		'Scroll vertical' => "fx:'scrollVert',easing:'easeOutQuart'",
		'Scroll horizontal with bounce' => "fx:'scrollHorz',easing:'easeOutBounce'",
		'Scroll vertical with bounce' => "fx:'scrollVert',easing:'easeOutBounce'",
		'Scroll horizontal elastic' => "fx:'scrollHorz',easing:'easeOutElastic'",
		'Scroll vertical elastic' => "fx:'scrollVert',easing:'easeOutElastic'",
		'Scroll left/down/right/up' => "fx:'scrollLeft,scrollDown,scrollRight,scrollUp',easing:'easeInBack'",
		'Turn down (images only)' => "fx:'turnDown'",
		'Turn left (images only)' => "fx:'leftDown'",
		'Uncover, sliding right (images only)' => "fx:'uncover',sync:0",
		'Zoom in/out (images only)' => "fx:'zoom',sync:0",
		'Zoom in elastic / Zoom out with a bounce out (images only)' => "fx:'zoom',speedIn:2000,speedOut:1000,easeIn:'easeOutElastic',easeOut:'easeInOutBack',sync:0",
		'Random (images only)' => "fx:'all'"
	)
);

The syntax of the array feed to set_custom_effects() is as follows:
array( [title of effect] => [JQuery Cycle effect setting] );

Look here for inspiration for your own JQuery Cycle effects:
http://jquery.malsup.com/cycle/browser.html

For easing effects look her:
http://gsgd.co.uk/sandbox/jquery/easing/
*/
SortableDataObject::add_sortable_class('SlideshowSlide');
Ejemplo n.º 3
0
<?php

SortableDataObject::add_sortable_class('BrandImage');
Object::add_extension("Product", "ProductBrandDecorator");
	public function Sortable()
	{
	   return (SortableDataObject::is_sortable_many_many($this->sourceClass())) || (SortableDataObject::is_sortable_class($this->sourceClass()));
	}
 public function Sortable()
 {
     return $this->IsReadOnly !== true && $this->controller->canEdit(Member::currentUser()) && (SortableDataObject::is_sortable_many_many($this->sourceClass()) || SortableDataObject::is_sortable_class($this->sourceClass()));
 }
//SortableDataObject::add_sortable_class('TopCleanUp');
SortableDataObject::add_sortable_class('AboutFaq');
SortableDataObject::add_sortable_class('Sponsor');
SortableDataObject::add_sortable_class('CleanUpSponsor');
SortableDataObject::add_sortable_class('GetInvolvedDownload');
SortableDataObject::add_sortable_class('LearnDownload');
SortableDataObject::add_sortable_class('LearnLink');
SortableDataObject::add_sortable_class('Staff');
SortableDataObject::add_sortable_class('Collaborator');
SortableDataObject::add_sortable_class('KeyContact');
SortableDataObject::add_sortable_class('MediaReleaseDownload');
SortableDataObject::add_sortable_class('MediaReleaseLink');
SortableDataObject::add_sortable_class('YoutubeLink');
SortableDataObject::add_sortable_class('ActionLink');
SortableDataObject::add_sortable_class('FormCategory');
SortableDataObject::add_sortable_class('FormItem');
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.org/themes/
SSViewer::set_theme('lyc');
// Add custom SiteConfig data
DataObject::add_extension('SiteConfig', 'CustomSiteConfig');
Object::add_extension('DataObjectSet', 'DataObjectSetExtension');
//Object::add_extension('Member','MemberProfileExtension');
// log errors and warnings
//SS_Log::add_writer(new SS_LogFileWriter('/log'), SS_Log::WARN, '<=');
// or just errors
//SS_Log::add_writer(new SS_LogFileWriter('/log'), SS_Log::ERR);
ini_set('memory_limit', '1000M');
define('TESTING_ENTRY_FORM', false);
define('TESTING_EMAIL', '*****@*****.**');
define('EMAIL_ADMINS', 'davis.dimalen@gmail.com, davis.dimalen@gmail.com');
<?php

/** 
 * DataObjectManager config file
 * This can be used to store registrations for SortableDataObject
 * e.g. SortableDataObject::add_sortable_class(MyDataObject')
 * Followed by /dev/build
 *
 * Otherwise, put SortableDataObject registrations in mysite/_config.php
 *
 */
SortableDataObject::add_sortable_classes(array("Organisation"));
// Allow DataObjectManager to take control of the AssetAdmin using the AssetManager field
DataObjectManager::allow_assets_override(true);
// Allow DataObjectManager to override some of the core CSS in the CMS (work in progress)
DataObjectManager::allow_css_override(false);
SimpleWysiwygField::set_default_configuration(array(array('cut', 'copy', 'paste', '|', 'bold', 'italic', 'underline', '|', 'left', 'center', 'right'), array('ol', 'ul', '|', 'hyperlink', 'unlink', 'image', '|', 'formats')));
	 public function dosort()
	 {
	    if(!empty($_POST) && is_array($_POST) && isset($this->urlParams['ID'])) {
	      $className = $this->urlParams['ID'];
	      if(stristr($className,"-") !== false) {
	       list($ownerClass, $className) = explode("-",$className);
	      }
	      $many_many = ((is_numeric($this->urlParams['OtherID'])) && SortableDataObject::is_sortable_many_many($className));
	      foreach($_POST as $group => $map) {
	        if(substr($group, 0, 7) == "record-") {
	          if($many_many) {
	            $controllerID = $this->urlParams['OtherID'];          
	            $candidates = singleton($ownerClass)->many_many();
	            if(is_array($candidates)) {
	              foreach($candidates as $name => $class)
	                if($class == $className) {
	                  $relationName = $name;
	                  break;
	                }
	            }
	            if(!isset($relationName)) return false;
	            list($parentClass, $componentClass, $parentField, $componentField, $table) = singleton($ownerClass)->many_many($relationName);            
	            foreach($map as $sort => $id)
	              DB::query("UPDATE \"$table\" SET \"SortOrder\" = $sort WHERE \"{$className}ID\" = $id AND \"{$ownerClass}ID\" = $controllerID");
	          }
	          else {
	            foreach($map as $sort => $id) {
	              $obj = DataObject::get_by_id($className, $id);
	              $obj->SortOrder = $sort;
	              $obj->write();
	            }           
	          }
	          break;
	        }
	      }
	    }
	}
 public static function set_sort_dir($dir)
 {
     self::$sort_dir = $dir;
 }
Ejemplo n.º 10
0
<?php

SortableDataObject::add_sortable_classes(array("ImageGalleryItem", "ImageGalleryAlbum"));
DataObject::add_extension("SiteTree", "ImageGallerySiteTree");
<?php

/*
 * Allow list to be sortable
 */
SortableDataObject::add_sortable_classes(array('Video'));