add function
This commit is contained in:
parent
fa44af1df8
commit
cd109d04cd
@ -70,19 +70,7 @@ $extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$sql = "SELECT rowid, code, label, url, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
|
||||
$socialnetworks = array();
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$socialnetworks[$obj->code] = array(
|
||||
'rowid' => $obj->rowid,
|
||||
'label' => $obj->label,
|
||||
'url' => $obj->url,
|
||||
'active' => $obj->active,
|
||||
);
|
||||
}
|
||||
}
|
||||
$socialnetworks = getArrayOfSocialNetworks();
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($id);
|
||||
|
||||
@ -2186,6 +2186,31 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
|
||||
return $rep;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get array of social network dictionary
|
||||
*
|
||||
* @return array Array of Social Networks Dictionary
|
||||
*/
|
||||
function getArrayOfSocialNetworks()
|
||||
{
|
||||
global $conf, $db;
|
||||
$sql = "SELECT rowid, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
|
||||
$socialnetworks = array();
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$socialnetworks[$obj->code] = array(
|
||||
'rowid' => $obj->rowid,
|
||||
'label' => $obj->label,
|
||||
'url' => $obj->url,
|
||||
'icon' => $obj->icon,
|
||||
'active' => $obj->active,
|
||||
);
|
||||
}
|
||||
}
|
||||
return $socialnetworks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show social network link
|
||||
*
|
||||
|
||||
@ -100,19 +100,7 @@ $extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$sql = "SELECT rowid, code, label, url, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
|
||||
$socialnetworks = array();
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$socialnetworks[$obj->code] = array(
|
||||
'rowid' => $obj->rowid,
|
||||
'label' => $obj->label,
|
||||
'url' => $obj->url,
|
||||
'active' => $obj->active,
|
||||
);
|
||||
}
|
||||
}
|
||||
$socialnetworks = getArrayOfSocialNetworks();
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array('usercard','globalcard'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user