mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
add method getModalBoxLinkAttributes()
This commit is contained in:
parent
36240ed21e
commit
80689dc9c1
|
@ -1256,6 +1256,25 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get attributes for a button opening a modal box
|
||||||
|
*
|
||||||
|
* @param array $config contains elements
|
||||||
|
* target: id of modal box
|
||||||
|
* remote: URL of data to be loaded into box
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getModalBoxLinkAttributes($config) { /* {{{ */
|
||||||
|
$attrs = array();
|
||||||
|
$attrs[] = array('data-target', '#'.$config['target']);
|
||||||
|
if(isset($config['remote']))
|
||||||
|
$attrs[] = array('href', $config['remote']);
|
||||||
|
$attrs[] = array('data-toggle', 'modal');
|
||||||
|
$attrs[] = array('role', 'button');
|
||||||
|
$attrs[] = array('class', $config['class']);
|
||||||
|
return $attrs;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get html for button opening a modal box
|
* Get html for button opening a modal box
|
||||||
*
|
*
|
||||||
|
@ -1268,6 +1287,12 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
||||||
function getModalBoxLink($config) { /* {{{ */
|
function getModalBoxLink($config) { /* {{{ */
|
||||||
$content = '';
|
$content = '';
|
||||||
$content .= "<a data-target=\"#".$config['target']."\"".(isset($config['remote']) ? " href=\"".$config['remote']."\"" : "")." role=\"button\" class=\"".(isset($config['class']) ? $config['class'] : "btn")."\" data-toggle=\"modal\"";
|
$content .= "<a data-target=\"#".$config['target']."\"".(isset($config['remote']) ? " href=\"".$config['remote']."\"" : "")." role=\"button\" class=\"".(isset($config['class']) ? $config['class'] : "btn")."\" data-toggle=\"modal\"";
|
||||||
|
$attrs = self::getModalBoxLinkAttributes($config);
|
||||||
|
$content = '<a';
|
||||||
|
if($attrs) {
|
||||||
|
foreach($attrs as $attr)
|
||||||
|
$content .= ' '.$attr[0].'="'.$attr[1].'"';
|
||||||
|
}
|
||||||
if(!empty($config['attributes'])) {
|
if(!empty($config['attributes'])) {
|
||||||
foreach($config['attributes'] as $attrname=>$attrval)
|
foreach($config['attributes'] as $attrname=>$attrval)
|
||||||
$content .= ' '.$attrname.'="'.$attrval.'"';
|
$content .= ' '.$attrname.'="'.$attrval.'"';
|
||||||
|
|
|
@ -305,9 +305,9 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$accessobject = $this->params['accessobject'];
|
$accessobject = $this->params['accessobject'];
|
||||||
echo "<nav class=\"navbar navbar-expand-lg navbar-dark bg-dark border-bottom fixed-top\">\n";
|
echo "<nav class=\"navbar navbar-expand-lg navbar-dark bg-dark border-bottom fixed-top\">\n";
|
||||||
echo " <a class=\"navbar-brand\" href=\"../out/out.ViewFolder.php?folderid=".$this->params['dms']->getRootFolder()->getId()."\"><img src=\"../views/bootstrap/images/seeddms-logo.svg\"> <span class=\"d-none d-md-inline-block\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."</span></a>\n";
|
echo " <a class=\"navbar-brand\" href=\"../out/out.ViewFolder.php?folderid=".$this->params['dms']->getRootFolder()->getId()."\"><img src=\"../views/bootstrap/images/seeddms-logo.svg\"> <span class=\"d-none d-md-inline-block ml-4\">".(strlen($this->params['sitename'])>0 ? $this->params['sitename'] : "SeedDMS")."</span></a>\n";
|
||||||
/* search form {{{ */
|
/* search form {{{ */
|
||||||
echo " <form action=\"../out/out.Search.php\" class=\"form-inline mr-auto\" autocomplete=\"off\">";
|
echo " <form action=\"../out/out.Search.php\" class=\"form-inline ml-4 mr-auto\" autocomplete=\"off\">";
|
||||||
if ($folder!=null && is_object($folder) && !strcasecmp(get_class($folder), $dms->getClassname('folder'))) {
|
if ($folder!=null && is_object($folder) && !strcasecmp(get_class($folder), $dms->getClassname('folder'))) {
|
||||||
echo " <input type=\"hidden\" name=\"folderid\" value=\"".$folder->getID()."\" />";
|
echo " <input type=\"hidden\" name=\"folderid\" value=\"".$folder->getID()."\" />";
|
||||||
}
|
}
|
||||||
|
@ -1258,6 +1258,25 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get attributes for a button opening a modal box
|
||||||
|
*
|
||||||
|
* @param array $config contains elements
|
||||||
|
* target: id of modal box
|
||||||
|
* remote: URL of data to be loaded into box
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getModalBoxLinkAttributes($config) { /* {{{ */
|
||||||
|
$attrs = array();
|
||||||
|
$attrs[] = array('data-target', '#'.$config['target']);
|
||||||
|
if(isset($config['remote']))
|
||||||
|
$attrs[] = array('href', $config['remote']);
|
||||||
|
$attrs[] = array('data-toggle', 'modal');
|
||||||
|
$attrs[] = array('role', 'button');
|
||||||
|
$attrs[] = array('class', $config['class']);
|
||||||
|
return $attrs;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get html for button opening a modal box
|
* Get html for button opening a modal box
|
||||||
*
|
*
|
||||||
|
@ -1270,6 +1289,12 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
||||||
function getModalBoxLink($config) { /* {{{ */
|
function getModalBoxLink($config) { /* {{{ */
|
||||||
$content = '';
|
$content = '';
|
||||||
$content .= "<a data-target=\"#".$config['target']."\"".(isset($config['remote']) ? " href=\"".$config['remote']."\"" : "")." role=\"button\" class=\"".(isset($config['class']) ? $config['class'] : "btn btn-secondary")."\" data-toggle=\"modal\"";
|
$content .= "<a data-target=\"#".$config['target']."\"".(isset($config['remote']) ? " href=\"".$config['remote']."\"" : "")." role=\"button\" class=\"".(isset($config['class']) ? $config['class'] : "btn btn-secondary")."\" data-toggle=\"modal\"";
|
||||||
|
$attrs = self::getModalBoxLinkAttributes($config);
|
||||||
|
$content = '<a';
|
||||||
|
if($attrs) {
|
||||||
|
foreach($attrs as $attr)
|
||||||
|
$content .= ' '.$attr[0].'="'.$attr[1].'"';
|
||||||
|
}
|
||||||
if(!empty($config['attributes'])) {
|
if(!empty($config['attributes'])) {
|
||||||
foreach($config['attributes'] as $attrname=>$attrval)
|
foreach($config['attributes'] as $attrname=>$attrval)
|
||||||
$content .= ' '.$attrname.'="'.$attrval.'"';
|
$content .= ' '.$attrname.'="'.$attrval.'"';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user