-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added icon media source and file selection + fields in separated wind…
…ow tab
- Loading branch information
Bert Oost
committed
May 6, 2014
1 parent
27e02d9
commit 35c3a1a
Showing
15 changed files
with
210 additions
and
60 deletions.
There are no files selected for viewing
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
core/components/quickstartbuttons/elements/chunks/dashboard/item.chunk.tpl
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
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
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
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
65 changes: 64 additions & 1 deletion
65
core/components/quickstartbuttons/model/quickstartbuttons/qsbbutton.class.php
100644 → 100755
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,65 @@ | ||
<?php | ||
class qsbButton extends xPDOSimpleObject {} | ||
|
||
class qsbButton extends xPDOSimpleObject { | ||
|
||
/** | ||
* {inheritdoc} | ||
* @param string $keyPrefix | ||
* @param bool $rawValues | ||
* @param bool $excludeLazy | ||
* @param bool $includeRelated | ||
* @return array | ||
*/ | ||
public function toArray($keyPrefix='', $rawValues=false, $excludeLazy=false, $includeRelated=false) { | ||
$arr = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated); | ||
|
||
// figure out the icon | ||
$icon = $this->getIcon(); | ||
if(!empty($icon) && is_array($icon)) { | ||
switch($icon['type']) { | ||
case 'custom': | ||
$arr['iconcls'] = ''; | ||
$arr['iconpath'] = $icon['value']; | ||
break; | ||
case 'preset': | ||
default: | ||
$arr['iconcls'] = $icon['value']; | ||
$arr['iconpath'] = ''; | ||
break; | ||
} | ||
} | ||
|
||
return $arr; | ||
} | ||
|
||
/** | ||
* Figures out the icon to use | ||
* @return array | ||
*/ | ||
public function getIcon() { | ||
|
||
$icon_ms = $this->get('icon_ms'); | ||
$icon_file = $this->get('icon_file'); | ||
if(!empty($icon_ms) && !empty($icon_file)) { | ||
|
||
/** @var modMediaSource|modFileMediaSource $ms */ | ||
$ms = $this->getOne('MediaSource'); | ||
if(!empty($ms) && is_object($ms)) { | ||
$ms->initialize(); | ||
|
||
$iconUrl = $ms->getObjectUrl($icon_file); | ||
if(!empty($iconUrl)) { | ||
return array('type' => 'custom', 'value' => $iconUrl); | ||
} | ||
} | ||
} | ||
|
||
/** @var qsbIcon $icon - Fallback */ | ||
$icon = $this->getOne('Icon'); | ||
if(!empty($icon) && is_object($icon)) { | ||
return array('type' => 'preset', 'value' => $icon->get('class')); | ||
} | ||
|
||
return array('type' => 'preset', 'value' => 'fa-chevron-right'); | ||
} | ||
} |
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
Oops, something went wrong.