Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
HIPO_Job_Tool_Search_Replace Class Reference
Inheritance diagram for HIPO_Job_Tool_Search_Replace:
HIPO_Job MySource_Object

Public Member Functions

 HIPO_Job_Tool_Search_Replace ($code_name='')
 
 getCodeName ()
 
 getHipoName ()
 
 getInitialStepData ()
 
 prepare ()
 
 getLockAssetDetails (&$job_type, &$running_vars, &$options)
 
 getRegenerateMetadataDetails (&$job_type, &$running_vars, &$options)
 
 getReindexAssetDetails (&$job_type, &$running_vars, &$options, &$hipo_vars)
 
 releaseLocks (&$step_data, $prefix)
 
 _getSearchCounts ()
 
 paintConfirmation (&$step_data, &$o, $prefix)
 
 processConfirmation (&$step_data, $prefix)
 
 _printAttributeMatches ($assetid, $prefix, &$attr_matches)
 
 _printMetadataMatches ($assetid, $prefix, &$meta_matches)
 
 _printSchemaMatches ($assetid, $prefix, &$schema_matches)
 
 _printContentMatches ($assetid, $prefix, &$div_matches)
 
 processContent (&$step_data, $prefix)
 
 processSchemas (&$step_data, $prefix)
 
 processAttributes (&$step_data, $prefix)
 
 processMetadata (&$step_data, $prefix)
 
 _getOccurrences ($needle, $haystack)
 
 _replaceOccurrences ($needle, $new_needle, $haystack, $offsets, $case_match=FALSE)
 
 _matchCapitals ($teacher, $student)
 
 _printRows ($needle, $haystack)
 
 _printHighlightedMatch ($needle, $haystack, $offset)
 
 _findBackBreak ($haystack, $offset, $limit=20)
 
 _findForwardBreak ($haystack, $offset, $limit=55)
 
 _setupMatches ()
 
 _updateSearchData ($prefix)
 
- Public Member Functions inherited from HIPO_Job
 HIPO_Job ($code_name='')
 
 getCodeName ()
 
 getHipoName ()
 
 getInitialStepData ()
 
 complete ()
 
 percentDone ()
 
getRunningVars ()
 
 setRunningVars (&$vars)
 
 setOption ($name, $value)
 
 getOption ($name)
 
 setHipoVar ($name, $value)
 
 getHipoVar ($name)
 
 _addError ($error, $warning=FALSE)
 
 getErrors ()
 
 prepare ()
 
 initialise ($source_code_name=NULL)
 
 getThreshold ()
 
 getThresholdPercentageRequired ()
 
 freestyle ()
 
 load ($code_name)
 
 save ($ignore_running_mode=FALSE)
 
 _updateProgress ()
 
 _renewLastUpdated ($new_time=NULL)
 
_getSubJob ()
 
 getInitialiseMode ()
 
 setRunningMode ($mode, $server_taskid='')
 
 getRunningMode ()
 
 autoStep ()
 
 getNextStep ()
 
 skipStep ($stepid=0)
 
 paint (&$o, $nested=FALSE)
 
 process ()
 
 processWeb (&$step_data, $prefix)
 
 processServer (&$step_data, $prefix)
 
 abort ($abort_source=TRUE, $abort_dependant=TRUE)
 
 jobAborted ()
 
 _paintErrorReport ()
 
 paintStepDefault (&$step_data, &$o, $prefix)
 
 _errorHandler ($err_no, $err_msg, $err_file, $err_line)
 
 getDependantHipoJob ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Additional Inherited Members

- Static Public Member Functions inherited from HIPO_Job
static paintConfig (&$o, $class, $write_access)
 
static getConfigVars ()
 
static paintProgressBar ($percent_done, $message='', $label_class='sq-hipo-progress-bar-label', $percent_class='sq-hipo-progress-bar-percent', $bar_main_class='sq-hipo-progress-bar-main', $bar_done_class='sq-hipo-progress-bar-done')
 
- Data Fields inherited from HIPO_Job
 $code_name = ''
 
 $source_code_name = ''
 
 $userid = 0
 
 $last_updated = 0
 
 $hipo_name = ''
 
 $is_prepared = FALSE
 
 $uses_trans = TRUE
 
 $_hipo_vars
 
 $_options
 
 $_running_vars = Array()
 
 $_current_mode = 'web'
 
 $_steps = Array()
 

Detailed Description

Definition at line 31 of file hipo_job_tool_search_replace.inc.

Member Function Documentation

_findBackBreak (   $haystack,
  $offset,
  $limit = 20 
)

Find a point in the string behind the current point to cutoff display at

Parameters
string$haystackThe string to check
int$offsetWhere to start
int$limitmaximum number of characters
Returns
string public

Definition at line 1155 of file hipo_job_tool_search_replace.inc.

_findForwardBreak (   $haystack,
  $offset,
  $limit = 55 
)

Find a point in the string to cutoff display at

Parameters
string$haystackThe string to check
int$offsetWhere to start
int$limitmaximum number of characters
Returns
string public

Definition at line 1199 of file hipo_job_tool_search_replace.inc.

_getOccurrences (   $needle,
  $haystack 
)

Get the indices at which needle occurs in haystack

Parameters
string$needleThe string being looked for
string$haystackThe string being looked through
Returns
array public

Definition at line 1010 of file hipo_job_tool_search_replace.inc.

_getSearchCounts ( )

Get the search count

Returns
void public

Definition at line 355 of file hipo_job_tool_search_replace.inc.

_matchCapitals (   $teacher,
  $student 
)

Match capitalisation of first string in the second

Parameters
string$teacherThe string to match
string$studentThe string to capitalise
Returns
string public

Definition at line 1085 of file hipo_job_tool_search_replace.inc.

_printAttributeMatches (   $assetid,
  $prefix,
$attr_matches 
)

Print matches from an asset's attributes

Parameters
string$assetidThe assets id
string$prefixPrefix for the fields
array&$attr_matchesMatches
Returns
void private

Definition at line 584 of file hipo_job_tool_search_replace.inc.

_printContentMatches (   $assetid,
  $prefix,
$div_matches 
)

Print matches from an asset's content

Parameters
string$assetidThe assets id
string$prefixPrefix for the fields
array&$div_matchesMatches
Returns
void private

Definition at line 739 of file hipo_job_tool_search_replace.inc.

_printHighlightedMatch (   $needle,
  $haystack,
  $offset 
)

Prints an example of $needle, in $haystack with highlighting

Parameters
string$needleThe string to highlight for
string$haystackThe string to look in
int$offsetWhere to find $needle
Returns
void public

Definition at line 1131 of file hipo_job_tool_search_replace.inc.

_printMetadataMatches (   $assetid,
  $prefix,
$meta_matches 
)

Print matches in an asset's metadata

Parameters
string$assetidThe assets id
string$prefixPrefix for the fields
array&$meta_matchesMatches
Returns
void private

Definition at line 636 of file hipo_job_tool_search_replace.inc.

_printRows (   $needle,
  $haystack 
)

Fill a table with highlighted search terms.

Parameters
string$needleThe string to match
string$haystackThe string to look in
Returns
void public

Definition at line 1109 of file hipo_job_tool_search_replace.inc.

_printSchemaMatches (   $assetid,
  $prefix,
$schema_matches 
)

Print matches in a metadata schema

Parameters
string$assetidThe assets id
string$prefixPrefix for the fields
array&$schema_matchesMatches
Returns
void private

Definition at line 688 of file hipo_job_tool_search_replace.inc.

_replaceOccurrences (   $needle,
  $new_needle,
  $haystack,
  $offsets,
  $case_match = FALSE 
)

Replace all instances of needle in the haystack that occur in offsets

Parameters
string$needleThe string being looked for
string$new_needleThe string to insert
string$haystackThe string being looked through
array$offsetsIndices of instances you wish to replace
boolean$case_matchWhether to match capitilisation of the needle in replace
Returns
string public

Definition at line 1053 of file hipo_job_tool_search_replace.inc.

_setupMatches ( )

Insert search matches into _running_vars

Returns
void public

Definition at line 1243 of file hipo_job_tool_search_replace.inc.

_updateSearchData (   $prefix)

Unset any search matches that are unneeded

Parameters
string$prefixPrefix for the fields
Returns
void public

Definition at line 1281 of file hipo_job_tool_search_replace.inc.

getCodeName ( )

Returns a unique codename the HIPO can use to ensure it is not being run twice

Returns
string public

Definition at line 55 of file hipo_job_tool_search_replace.inc.

getHipoName ( )

Returns the (localised) HIPO name

Returns
string public

Definition at line 68 of file hipo_job_tool_search_replace.inc.

getInitialStepData ( )

Returns the steps in this hipo, possibly with localised step names and messages

Returns
string public

Definition at line 82 of file hipo_job_tool_search_replace.inc.

getLockAssetDetails ( $job_type,
$running_vars,
$options 
)

This function is used to set-up the details for locking the assets by the nested HIPO_Job

Parameters
string&$job_typeJob type
array&$running_varsJob vars
array&$optionsOptions
Returns
void public

Definition at line 233 of file hipo_job_tool_search_replace.inc.

getRegenerateMetadataDetails ( $job_type,
$running_vars,
$options 
)

This function is used to set-up the details for the regenerate metadata nested HIPO_Job

Parameters
string&$job_typeJob type
array&$running_varsJob vars
array&$optionsOptions
Returns
void public

Definition at line 259 of file hipo_job_tool_search_replace.inc.

getReindexAssetDetails ( $job_type,
$running_vars,
$options,
$hipo_vars 
)

This function is used to set-up the details for the reindex assets nested HIPO_Job

Parameters
string&$job_typeType of job
array&$running_varsJob vars
array&$optionsOptions
array&$hipo_varsHipo vars
Returns
void public

Definition at line 284 of file hipo_job_tool_search_replace.inc.

HIPO_Job_Tool_Search_Replace (   $code_name = '')

Constructor

Parameters
string$code_namea unique codename the HIPO

Definition at line 40 of file hipo_job_tool_search_replace.inc.

paintConfirmation ( $step_data,
$o,
  $prefix 
)

Paints some option for the user to specify what replacements are to be made as a result of the search

Parameters
array&$step_dataa reference to the step data for this step
object&$othe hipo backend outputter object
string$prefixa string for prefixing form variables
Returns
boolean public

Definition at line 403 of file hipo_job_tool_search_replace.inc.

prepare ( )

Prepares the running vars and gets the children of the asset in question

Returns
boolean public

Definition at line 211 of file hipo_job_tool_search_replace.inc.

processAttributes ( $step_data,
  $prefix 
)

Proccess replacements in Attribute fields

Parameters
array&$step_dataa reference to the step data for this step
string$prefixa string for prefixing form variables
Returns
boolean public

Definition at line 892 of file hipo_job_tool_search_replace.inc.

processConfirmation ( $step_data,
  $prefix 
)

Processes the confirmation/match selection step of the HIPO

Parameters
array&$step_dataa reference to the step data for this step
string$prefixa string for prefixing form variables
Returns
boolean public

Definition at line 508 of file hipo_job_tool_search_replace.inc.

processContent ( $step_data,
  $prefix 
)

Process replacements in asset contents

Parameters
array&$step_dataa reference to the step data for this step
string$prefixa string for prefixing form variables
Returns
boolean public

Definition at line 789 of file hipo_job_tool_search_replace.inc.

processMetadata ( $step_data,
  $prefix 
)

Process replacements in Metadata fields

Parameters
array&$step_dataa reference to the step data for this step
string$prefixa string for prefixing form variables
Returns
boolean public

Definition at line 943 of file hipo_job_tool_search_replace.inc.

processSchemas ( $step_data,
  $prefix 
)

Process replacements in schema

Parameters
array&$step_dataa reference to the step data for this step
string$prefixa string for prefixing form variables
Returns
boolean public

Definition at line 839 of file hipo_job_tool_search_replace.inc.

releaseLocks ( $step_data,
  $prefix 
)

Release the locks that were acquired while cloning assets

Parameters
array&$step_dataa reference to the array of information about the current step
string$prefixprefix for form vars
Returns
boolean public

Definition at line 312 of file hipo_job_tool_search_replace.inc.


The documentation for this class was generated from the following file: