$loadedRows = count($current); foreach ($current as &$line) { $bits = explode('|', $line); $line = array(); foreach ($bits as $bit) { $line[] = explode(',', $bit); } } $rowCount = max($loadedRows, 1) + 1; } else { $rowCount = 1; } $init = ''; $setup = ''; $map = array(); $qtlist = Toolbar::getList(); $usedqt = array(); $qt_p_list = array(); $qt_w_list = array(); foreach ($current as &$line) { foreach ($line as $bit) { $usedqt = array_merge($usedqt, $bit); } } $customqt = Toolbar::getCustomList(); $view_mode = !empty($_REQUEST['view_mode']) ? $_REQUEST['view_mode'] : ''; foreach ($qtlist as $name) { $tag = Toolbar::getTag($name); if (!$tag) { $tag = Toolbar::getTag($name, true); if (!$tag) {
public static function saveTool($name, $label, $icon = 'img/icons/shading.png', $token = '', $syntax = '', $type = 'Inline', $plugin = '') { global $tikilib; $name = strtolower(TikiLib::remove_non_word_characters_and_accents($name)); $standard_names = Toolbar::getList(false); $custom_list = Toolbar::getCustomList(); if (in_array($name, $standard_names)) { // don't allow custom tools with the same name as standard ones $c = 1; while (in_array($name . '_' . $c, $custom_list)) { $c++; } $name = $name . '_' . $c; } $prefName = "toolbar_tool_{$name}"; $data = array('name' => $name, 'label' => $label, 'icon' => $icon, 'token' => $token, 'syntax' => $syntax, 'type' => $type, 'plugin' => $plugin); $tikilib->set_preference($prefName, serialize($data)); if (!in_array($name, $custom_list)) { $custom_list[] = $name; $tikilib->set_preference('toolbar_custom_list', serialize($custom_list)); } }