Our solution provides a simple website publishing software for your staff to confidentially modify your website content (text & images) independently from all the complex programming & scripting required to maintain your custom business website.
updateCase-v5.php is now DEPRECIATED
- Instead logon to UpdateCase.com and download "UpdateCaseUtil.php" from the configuration screen
- Save to your CakePHP 4.x project
- src/Util/UpdateCaseUtil.php
- Prepare your account on UpdateCase.com
- Include this client on your website
- Use UpdateCase.com - You can copy the methods to add to your source files
- Non-technical team can now update content (text / images) independently from technical team while ensuring branding is maintained
- Your technical team can now focus on more complex and effective updates instead of making text and image updates
- ARGS: (array $options)
- Useage: $updateCase->__construct(array $options)
$this->updateCase = new UpdateCase(['debug' => true,'variant_id' => $variant_id,'version' => 6,'lang' => $this->request->getAttribute('lang')]);
@param array $options
# debug true will force network connections while false will only use local cached data
# variant_id required to interface with updateCase.com and get the correct data
# version 5 is the current version
# lang which language to use (supported: en/es/fr)
@return array entire structure which can be passed into the view
- ARGS: ()
- Useage: $updateCase->init_prepareJson()
Sets up the JSON file and formatts all the interal variables
@return bool|int
- ARGS: ()
- Useage: $updateCase->sync()
Access this from a public website page eg Pages/sync which will get the new content from UpdateCase
@return local_uuid
- ARGS: ($maxRecentRows = 20)
- Useage: $updateCase->debug($maxRecentRows = 20)
@param $maxRecentRows # default to 20 can be increased to see further back
@return string # can be echo'd to see a complete log of the actions to diagnose any issues and understand exactly what is happening
- ARGS: ($variant_id)
- Useage: $updateCase->changeVariant($variant_id)
Allows to switch to a different variant_id which is useful when you want to share content between websites
@param $variant_id
@return void
- ARGS: ($slug)
- Useage: $updateCase->changePage($slug)
Switch to a different slug (or page on UpdateCase.com)
@param $slug
@return bool
- ARGS: (string $locationName, string
- Useage: $updateCase->getContentBy(string $locationName, string
Display content added to UpdateCase. Best to copy-and-paste directly from site to save time setting up.
@param string $locationName
@param string $elementName
@param string $groupName # allows to use groups and loop blocks
@param string $slug # allows to display content from a specific slug without 'changeSlug'
@return string content which was added to UpdateCase.com
- ARGS: ($locationName, $elementName, $groupName
- Useage: $updateCase->getImageBy($locationName, $elementName, $groupName
This will cache images from UpdateCase.com to website (webroot)
@param $location
@param $element
@param $group
@param $size # medium / thumb / large (still alpha functionality)
@param $slug # conditional to get image without using changeSlug
@return false|string # will return the url to the image on the webroot, can be added to img src="$webroot.$updateCase->getImageBy.....
- ARGS: ()
- Useage: $updateCase->currLang()
Get the active language (en/es/fr)
@return mixed
- ARGS: ()
- Useage: $updateCase->getMetaTitle()
Get the Meta TITLE either from the active slug (page) or if that does not exist on UpdateCase.com the ALL slug (page) Meta title will be returned instead
@return string
- ARGS: ()
- Useage: $updateCase->getMetaDescription()
Get the Meta DESCRIPTION either from the active slug (page) or if that does not exist on UpdateCase.com the ALL slug (page) Meta title will be returned instead
@return string
- ARGS: ()
- Useage: $updateCase->getMetaKeywords()
Get the Meta KEYWORDS either from the active slug (page) or if that does not exist on UpdateCase.com the ALL slug (page) Meta title will be returned instead
@return string
- ARGS: ($name)
- Useage: $updateCase->getMetaProperty($name)
Get the Meta TITLE/KEYWORDS/DESCRIPTION either from the active slug (page) or if that does not exist on UpdateCase.com the ALL slug (page) Meta title will be returned instead
@param $name # use 'title' OR 'keywords' OR 'description'
@return string
- ARGS: ($lang)
- Useage: $updateCase->getMetaOgLocale($lang)
OG LOCALE requires a full language string
@param $lang
@return false|string
- ARGS: ($date)
- Useage: $updateCase->setDate($date)
Allows to change the date which is used to simulate events in the future / past to test conditional locations
@param $date
@return void
- ARGS: ()
- Useage: $updateCase->getDate()
What date the UpdateCase client is using
@return false|string
- ARGS: ($currLocationName)
- Useage: $updateCase->isLocationActive($currLocationName)
@todo bring this into the getContentBy above
@param $currLocationName
@return bool
- ARGS: ($slug)
- Useage: $updateCase->doesSlugExist($slug)
Check if a slug was created on UpdateCase.com
@param $slug
@return bool
- ARGS: ($tagName, $sortBy =
- Useage: $updateCase->getPageSlugsByTag($tagName, $sortBy =
List of slugs from a tag useful to get and display all pages from a tag
@param $tagName
@param $sortBy
@param $ensureAllTags
@param $limitToLang
@return array
- ARGS: ()
- Useage: $updateCase->getPageLangs()
Languages present in current page (slug) within ALL locations / elements
@return array
- ARGS: ($format = 'Y-m-d H:i:s')
- Useage: $updateCase->getPageDate($format = 'Y-m-d H:i:s')
Page date which is set on UpdateCase.com
@param $format # PHP date format
@return false|string
- ARGS: ()
- Useage: $updateCase->getPage()
The page that was loaded from changeSlug
@return array
- ARGS: ($ignore = [])
- Useage: $updateCase->getTagsFromAllPages($ignore = [])
All the tags for every page within the loaded variant
@param $ignore # array allowing to ignore a list
@return array
- ARGS: ($tag)
- Useage: $updateCase->isTagPresent($tag)
Is the tag present in the loaded page (slug)
@param $tag
@return bool
- ARGS: ($ignore = [])
- Useage: $updateCase->getTags($ignore = [])
The tags from the current loaded page (slug)
@param $ignore
@return array
- ARGS: ($term, $element =
- Useage: $updateCase->translate($term, $element =
Translate a word using the translation function located in UpdateCase.com
@param $term
@param $element # eg en->fr meaning we are adding english terms which appear as french when echo'd
@return false|mixed|string
- ARGS: ($locationName, $elementName =
- Useage: $updateCase->exists($locationName, $elementName =
Check if this location / element can be used and exists on UpdateCase.com
@param $locationName
@param $elementName
@param $groupName
@return bool|void
- ARGS: ($locationName, $elementName =
- Useage: $updateCase->isEmpty($locationName, $elementName =
When it exists by if the content is empty
@param $locationName
@param $elementName
@param $groupName
@return bool
- ARGS: ($locationName, $elementName =
- Useage: $updateCase->isNotEmpty($locationName, $elementName =
Not empty so there IS content available
@param $locationName
@param $elementName
@param $groupName
@return bool
- ARGS: ($search, $locationName, $elementName
- Useage: $updateCase->doesContain($search, $locationName, $elementName
Useful for searches to see if a string of text is available
@param $search # string search term
@param $locationName
@param $elementName # optional
@param $groupName # optianal
@return bool
- ARGS: ($slug, $locationName, $elementName
- Useage: $updateCase->existsInPage($slug, $locationName, $elementName
@param $slug
@param $locationName
@param $elementName # optional
@param $groupName # optional
@return bool|void
- ARGS: ($searches, $limitToTag =
- Useage: $updateCase->getPagesBySearch($searches, $limitToTag =
Search feature to give string or array of search terms to get the slug where they are available
@param array|string $searches # allows to search for slugs from
@param $limitToTag
@return array|false|void # this returns a complex array with all the data
- ARGS: ($searches)
- Useage: $updateCase->getPageSlugsBySearch($searches)
Allow to search for a string or array or strings and get the slugs where they are available
@param array|string $searches
@return array|false # slugs which contain the search
- ARGS: ($year)
- Useage: $updateCase->getPageSlugsByYear($year)
All pages (slugs) are stored on UpdateCase.com with a date, this allows to get a list from a specific year
@param $year
@return array|false
- ARGS: ($ignore = false)
- Useage: $updateCase->getLocationNames($ignore = false)
List of location names from the currently loaded page (slug)
@param $ignore # conditional
@return void
- ARGS: ($locationName, $field)
- Useage: $updateCase->getUniqueNameForFieldByLocation($locationName, $field)
@param $locationName
@param $field
@return array
- ARGS: (string $text, $limit
- Useage: $updateCase->getTextOnly(string $text, $limit
Text without any html tags
@param string $text # html content
@param int $limit # allow to get a portion back with '...' appended
@return false|string
- ARGS: ($string)
- Useage: $updateCase->removeImages($string)
Remove the image tags from a string
@param $string
@return string
- ARGS: ($str)
- Useage: $updateCase->removeHtmlElements($str)
Remove the HTML elements from a string
@param $str
@return array|string|string[]|null
- ARGS: ($url, $prefix =
- Useage: $updateCase->ensureHttpOrHttps($url, $prefix =
Easily make sure your path has either https:// OR http://
@param $url
@param $prefix # http:// OR https://
@return string
- ARGS: ($str)
- Useage: $updateCase->cleanUpStringForQuotedSections($str)
Quotes will only be SINGLE QUOTES, allows to safely add to html tags that are double quotes and not break the tag
@param $str
@return array|string|string[]
- ARGS: ($remove, $string)
- Useage: $updateCase->removeTextFrom($remove, $string)
@param $remove
@param $string
@return array|string|string[]
- ARGS: ($url)
- Useage: $updateCase->ensureHttp($url)
DEPRECATED use ensureHttpOrHttps
- ARGS: ()
- Useage: $updateCase->getApiList()
Allows to view all the functions within your software and verify they are properly setup
@return array